Skip to main content
All CollectionsData Model management
I want to copy data from one document to another
I want to copy data from one document to another

An attribute is set on a document. You want this data to be available on a linked document. Here are the possible solutions

Sylvain Gourvil avatar
Written by Sylvain Gourvil
Updated over 4 months ago

In this article, we'll illustrate how to manage a "Material" attribute at the "Product Color" level from a "Material" attribute already present at the "Product" level.

We will present three different methods for achieving this objective.

Context

Let's assume that

  • the data model comprises two entities: "Product" and "Product Color";

  • the "Material" attribute is initially filled in at the "Product" level by a user.

  • you wanted to be able to view this material at the "Product Color" level.

Solutions

Preparation

It is necessary to create a "Material" attribute at the "Product Color" level, which will host the values of the "Material" attribute at the "Product" level.

This attribute must be non-editable, as it is a copy. In fact, the master data remains managed at the "Product" level.

Method 1: Export / Import

Steps

  1. Export data
    Export products with a join to color products.
    The exported file will contain product data and associated color products.

  2. File modification
    If necessary (not compulsory), delete all columns except those containing the code of Color Product documents and material data.

  3. Re-import data

    Prepare an import with the exported file.

    Map the "product-material" column to the "product-color-material" attribute in the exported file.

    Launch import

Your "Products" data has now been imported into "Product-Colors".

Advantage

The imported file appears in the activity table, allowing easy monitoring and verification.

Disadvantages

Data is copied with a delay predetermined by the script orchestration (e.g. every hour).

Can it be automated?

This method can be automated via :

  • API

  • Automation platforms such as Make.com or Zapier

Method 2: Using the API to copy data

Steps

  1. Retrieve modified "Products"
    Use the GET /documents API with a filter on

    • the "Product" document type

    • update date to retrieve products that have been modified within a certain period of time

  2. Retrieve associated "Product Color"
    Use the links resources from the response payload to obtain the "Product Color" codes.

  3. Updating "Product Color"

    Use the PUT /documents/xxx API to update the "product-color-matter" attribute of the "Product Color" concerned.

Benefits

This method enables fine-tuned management of updates based on recent modifications.

Disadvantages

  • Data is copied with a delay predetermined by the script orchestration (e.g. every hour).

  • All updated "Product" documents are scanned, even if the "Material" attribute has not been modified.

Method 3: Using Webhook Notifications

Steps

  1. Setting up notifications
    Set up a webhook to be notified in real time of document modifications.

  2. Handling notifications

    Use the GET /documents/xxx API to retrieve the "Product" when a notification is received indicating that :

    • the document type is "Product

    • the "Material" attribute has been modified

  3. Updating "Color Products"
    Use the links resources from the response payload to obtain the "Product Color" codes.
    Then update the "product-color-material" attribute of each "Color Product".

You will find attached the "make.com" blueprint that can be imported.

Quable PIM - Make.com blueprint

Benefits

  • Data is updated in near-real time.

  • Only relevant events are processed.

Disadvantages

  • Requires an HTTP server to host notifications.

  • Tools such as Make.com or Zapier can make this easier.

Conclusion

Each of these methods has its own advantages and disadvantages.

The choice of method will depend on your organization's specific needs in terms of update time and implementation complexity.

For near-instant synchronization and precise event management, the webhook notification method is recommended.

For less urgent needs, export/import or API methods may be sufficient.

Did this answer your question?