I am getting a strange “Unexpected Identifier” error linked to the Map Items or Load Table objects blocks, I am not sure.
I am also unable to clarify the logic I need to:
Filter out the objects that need updating
Create a list of the external API data that I can then use with a bulk update block. I somehow need to combine the objectids from the database with the external API data and I don’t know how to do that.
Any pointers in the right direction would be much appreciated!
Create a variable externalApiList containing a simple array of 2 objects with properties = name, order, updated. This will supposedly come from an External API
Create a variable updateList that contains the objects in the external Api list with “updated” property which is larger or equal to the “updated” property in the dbList object, but also includes the objectId from the corresponding dbList item
The array should not include the object with “order”: “59” since the updated field of the object in the database is larger than the updated field of the object from the external API.
I want to update the database with the objects in the updateList variable.
The object must have an objectId property of the item that needs to update.
If you found an item that must be updated, you save him to a variable, use Set property to this object with a new value of the order, and save to DB
About your logic, I think dbList not needed if you no need return this list from this API, you just iterate over the External API list, find a needed object in DB and update him.