- Introduction
- The Route
- Incoming Configuration
- Outgoing Configuration
- Entity Transformer
- Making The Connection: A Step-by-step Guide
- Data X
- Filtering Out Unnecessary Tasks When Products Don’t Change
- Data Y
- Closing Thoughts!
CommerceTools
Transferring products from XML/sFTP
Guide: transfer products from an XML file on sFTP to commercetools with Alumio.
TABLE OF CONTENTS
So, in the above example of data X, we are considering three products namely Alumio T-shirt, Alumio Hat, and Alumio Hoodie respectively. So, each of these products has a name and a status that indicates whether it should or should not be published.
Step 1.2: Now, upload this file to the sFTP environment and then go back to Alumio.
Step 1.3: Go to the Incoming Configurations of the Route: Get Products From XML, and click on Run Incoming button at the top-right corner.
As you run the Incoming configuration, it will connect to the sFTP environment and look for a file called products.xml.
Step 1.4: A “Subscriber has been consumed” pop-up box will appear. Hit on Click to view more information just beneath it.
Step 1.5: Click on Logs. You can see that Alumio has created tasks (3). To verify this, you can go to the Dashboard (left-hand panel of Alumio). It will show that 3 New tasks have been created.
Step 1.6: Go to Dashboard>Tasks and here you will see that all the three tasks belong to the single route called Products from XML to CommerceTools. The entity identifiers will show alumio-hoodie, alumio-hat, and alumio-t-shirt.
Step 1.7: Open any one of the tasks. For example, let’s say you open the task with the Identifier: alumio-hat.
Step 1.8: Click on Entity Data at the top to view the corresponding data for the task. In this case, what you will see is:
This is the data retrieved from XML.
As soon as you execute the Route or export the data from Alumio to CommerceTools, the data will get mapped to a format that is compatible with CommerceTools. Eventually, the products will get created on the CommerceTools.
Step 2.1: Go back to Routes (Products from XML to CommerceTools) and click on Run Route (top-right corner). A “Publish has been exported” pop-up box will appear.
Step 2.2: Revert back to the task (step 1.7). Click on Overview and refresh it.
Step 2.3: Now, you will see that the Status is showing FINISHED (in green).
Step 2.4: Revisit the CommerceTools merchant center and refresh it. Now, three products will appear (Alumio Hoodie, Alumio T-Shirt, and Alumio Hat), which were created by the execution of the Route.
If you look at the status, you will see that the Status for each of them has also been mapped successfully. Alumio Hoodie has been Published (refer to Data X) while the Alumio T-shirt and Alumio Hat remain Unpublished.
Here, you can change the name of the second product from Alumio Hat to Alumio Hat 123 for example.
Also, you can add a new product called Alumio Trousers.
Step 3.11: Add data Y (new XML file) to the sFTP environment again (you might have to override the data).
Step 3.12: Repeat Step 3.5 and Step 3.6. Now, you can expect two new tasks to be created here- one for the changed product and one for the new one.
Step 3.13: Click on Logs and this time you will see that there are two new tasks which have been created. If you revisit the Dashboard, you will see that 2 New tasks are being reflected there as well.
Click on the New Tasks and the two new tasks will be reelected here.
If you check the Entity Identifier, you shall see that two tasks have been created for alumio-hat and alumio-trousers (which reflects the change we made in step 3.10).
If you click on the task for alumio-hat and check the Entity Data, it will reflect the changes.
Similarly, If you click on the task for alumio-trousers and check the Entity Data, you can see that the data has been retrieved for the new product.