When getting data from a WooCommerce, Magento or whatever form based API, all fields and values are returned in a (generic) attribute list format. To use this data easily, it would be great if the data is converted to a object. So we can pull the data of the object from there.
Example of data from Magento:
[ { "field_id": "1", "code": "Firstname", "value": "John" }, { "field_id": "2", "code": "Lastname", "value": "Doe" }, { "field_id": "3", "code": "Email", "value": "test@test.com" } ]
To pull each individual field out of this list and store it in Dataverse (for example) can be done with the Filter Array data operation. For a lot of fields (that might change periodically), this is very time consuming. So I tried to build some flow steps that pull out each field from the attribute list and add it to an object. So I am able to use an object in the subsequent flow actions.
To do this, I loop through each item and add both the ‘code’ and ‘value’ (in this example) fields to a (text variable) JSON “object”:
When the JSON text object is created, I parse it.
The following object was the result of parsing the text object that was generated from the example attribute list
So, that’s how I did it. Any suggestions? Or easier solutions? Please respond to elowy@grootcrm.net. Thanks!