Hello Friends,
I need help related to looping multiple records trying inserting multiple rows into SQL database, but the first record sometimes gets skipped, while the rest insert fine.
I am getting data from emailme form which i wanted to store in SQL database but data i am storing in rows. I mean to say if my form build with 10 fields then those 10 fields data (label as question and value as answer) is storing in database in different rows with some repeated information.
Like form fields are event_id, event_location, event_name, what is your name, what is your age, where do you live.
so the data should be store in database like
event_id event_location event_name question answer
101 USA birthday What is your name nova
101 USA birthday What is your age 25
101 USA birthday Where do you live Canada
and to achieve this i have multiple task in one zap with loop to store all the fields data in different rows.
I am using multiple zap steps to achieve this, like i can say 16 steps in one zap, steps are as mentioned below
- Webhook to catch the submitted data
- Formatter by zapier to get event id only
- Formatter by zapier to get event name only
- Formatter by zapier to fix multiple images been uploaded
- Formatter by zapier to get all questions
- Formatter by zapier to get all answers
- Delay by zapier (added new step to add delay before loop started)
- Loop by zapier to loop through all the fields (questions and answers)
- SQL server - Find Row via Custom Query to identify if record already submitted ( if not submitted it will go towards Add New Row and if submitted then it will go towards Update Row)
- Path - to split into paths
- Path - if record not exists
- Code by zapier if field value is empty then put NA as answer
- SQL Server New Row
- Path - if record exists
- Formatter by zapier if field value is empty then put NA as answer
- SQL Server Update Row
Please help if its possible to store all the records in database everytime.
FYI: Sevent Step Delay i have added recentlly. Because after my research i found Zapier sometimes starts the loop before the array is fully built or before index 0 is ready, that is why sometimes first loop is skipped. To fix this have added delay before the loop























