I am querying sendgrid to get all the bounces that are generated in a day and am getting the following json:
[
{
"created": 1658050606,
"email": "[email protected]",
"reason": "554 30 Sorry, your message to [email protected] cannot be delivered. This mailbox is disabled (554.30).",
"status": "554"
},
{
"created": 1658050598,
"email": "[email protected]",
"reason": "552 3 Requested mail action aborted, mailbox not found",
"status": "552"
},
{
"created": 1658050007,
"email": "[email protected]",
"reason": "552 1 Requested mail action aborted, mailbox not found",
"status": "552"
}
]
Then I am trying to use the mysql node to do an insert on all the email address and status from above.
Problem is I do not know how to iterate this so it goes one by one on the insert,
Not behind a pc right now. So not able to get you an example.
It should be fairly straightforward though.
Add the node. Select the option called split items . Enter the field name where you got the array.
Your data should be listed in a field when receiving it from the node before.
I see you are using HTTP request node now. (didn’t see that on my phone)
So @MutedJam has given you an easier solution.
Now onto my next issue, inside the MySQL node I am running an update execution. Inside my database I have the email field set to UNIQUE so that there are not duplicate entries. When I execute this node it stops on the first entry if there is already an entry for the first email address.
I have checked out the options and am not able to find out how to make it continue to iterate on all the other results.
My first guess was the continue on fail option. But this doesn’t continue executing other items within the same node If I read the info correctly.
Maybe this option does exactly that:
Otherwise I think you will need to get the records and remove duplicates first before sending them to mysql.
Not sure though, as I never really use MySQL.
Thanks @BramKn - this option of ignore does not exist in the mysql node.
I have tried the following options but alas still not acting the way I would want it to: