I am attempting to update the number of email attempts in my Microsoft SQL database each day. I have built the following workflow and it does iterate as expected. However, the output of the “Update Email Attempts” node uses the data from the first item for each execution. Hence, only a single record in the database gets updated…and it gets updated multiple times with the data depending on the total number of events returned from the “Retrieve Completed Events” node.
An example JSON of completed events looks like this:
[
{
"recordId": 43,
"eventName": "Older Event 2",
"eventlocation": "UGA Stadium",
"eventDate": "12/02/2021",
"emailAttempts": 1,
"userEmail": "[email protected]"
},
{
"recordId": 44,
"eventName": "Participants Test 1",
"eventlocation": "Who KNows",
"eventDate": "12/07/2021",
"emailAttempts": 0,
"userEmail": "[email protected]"
},
{
"recordId": 61,
"eventName": "outer space",
"eventlocation": "outer most rim",
"eventDate": "12/05/2021",
"emailAttempts": 0,
"userEmail": "[email protected]"
}
]
The expected output would be to have each of the individual records (identified by their recordId) updated with their respective calculations (incremented by 1 over their existing value). Currently, if three events are returned, the first event gets its email attempts incremented by 1 (and the new value gets written as many times as there are events / batches).
Any guidance as to what I am missing would be appreciated.