We'll take a simple example that can be used for any rule and any type of attribute.
Let's say that your data model has three attributes for a product document type:
color
: the color of your product, possibly enriched via imports from your ERP;
marketing_label
: the marketing name of your product, enriched by the teams within the PIM;
marketing_description
: the marketing description of your product. This attribute must be filled in as follows:{
marketing_label} - {color}
Two solutions are available when defining business processes:
The user entering the label also enters the description;
A script (ETL, specific development, etc.) retrieves the data after modification, creates the value, and pushes this data into the PIM
We'll focus on the second method. Obviously, we won't talk about how to set up the ETL job nor how to manage your rules. We'll only discuss the “PIM > ETL” and “ETL > PIM” flows.
Data recovery by ETL
Three methods are possible, each with its own advantages and disadvantages.
Push Notification Webhook & API
This is the most direct method. Notifications allow you to receive all document updates with details about modified attributes and the locales used at the very moment they're made.
When you receive these notifications on your systems, you can :
Decide if the modification is interesting. In our case, the only notifications to be taken into account are those declaring a modification on
color
ormarketing_label
If this is the case, the API must be used to get the information live:
https://yourpim.quable.com/api/ → documents (v5)
You'll then have all the information to calculate the value of the calculated attribute.
All that remains is to push the information to the PIM via API (https://docs.quable.com/reference/2-import-documents#edit-documents).
Thus, the calculation is nearly synchronous:
You receive the notification as soon as the modification is done, and
you're sure to send back the calculated value as soon as possible.
On the other hand, you must have an HTTP endpoint on your information system that is able to review these notifications.
Note: It's possible to store notifications received from the PIM in a queue (regardless of the technology). This allows processing notifications in batches (e.g., every X minutes).
API
If using notifications isn't a good option, or you don't need to be as precise (in terms of time), you can also retrieve all documents modified since a certain period of time via API:
Once the data is retrieved, your job will be able to calculate the values and push them via API or CSV:
Push via API : https://docs.quable.com/reference/2-import-documents
Push via CSV (2 possible methods):
Drop the file on the FTP(s) and scheduled imports: https://docs.quable.com/docs/imports-planifi%C3%A9s
Push the CSV file via API: https://docs.quable.com/reference/import
Export CSV
If using notifications isn't a good option or if you don't need to be as precise (in terms of time), you can also retrieve all documents modified since a certain period of time via CSV. In fact, you can schedule an export of your CSV data directly in Quable PIM to an FTP(s): https://docs.quable.com/docs/exports-planifies.
This allows your job to :
Process the CSVs ;
Calculate the calculated values;
Create a CSV file in order to import it;
Push these files to the PIM (2 possible methods):
Drop the file on the FTP(s) and scheduled imports: https://docs.quable.com/docs/imports-planifi%C3%A9s
Push the CSV file via API: https://docs.quable.com/reference/import
Keywords: calculated attribute, concatenation, calculated value, concatenated attribute