Select to view content in your preferred language

How do you pass Survey123 repeat records to Excel Online using Power Automate?

1898
6
Jump to solution
12-21-2022 01:28 PM
AlexGIS
New Contributor

I'm attempting to use the add row to table excel function to pass records from Survey123 to multiple tables stored in SharePoint using Power Automate. I ultimately want a new record added each time a Survey123 response is submitted or edited.

My survey contains 4 repeats but no nested repeats.

I started by creating an excel online workbook with 5 tables (1 for main survey table, 4 for repeat questions) and fields according to those made in Survey123.

I have one flow working which writes to the main table but I'm running into issues when I try to create a parallel branch in the same flow that writes each of the repeat records to the appropriate 'repeat' table.

I want to add a new row for each repeat record but I'm having difficulty figuring out the appropriate flow to do this and haven't had much luck finding solutions searching online.

What should be the standard flow in Power Automate for adding new rows to a table for each record in a repeat from Survey123?

0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @AlexGIS

You will need to use an apply to each function along with variables to store the values from the repeat(s) into the variables and then append to your table. 

Your repeats will be modeled as an object in your webhook which is why the apply to each is needed in order to loop through each repeat record and extract its information. 

Thank you,
Zach

View solution in original post

6 Replies
ZacharySutherby
Esri Regular Contributor

Hello @AlexGIS

You will need to use an apply to each function along with variables to store the values from the repeat(s) into the variables and then append to your table. 

Your repeats will be modeled as an object in your webhook which is why the apply to each is needed in order to loop through each repeat record and extract its information. 

Thank you,
Zach
AlexGIS
New Contributor

Thank you Zach! That helped! I was having issues where apply to each would sometimes get nested for each field and Power Automate wouldn't let me delete it so I had to keep creating a new flow. I read in another post (can't find at the moment) that only happens when you add certain survey elements instead of an attribute.

0 Kudos
santamariaa
Occasional Contributor

Hi! 

Do you have a screenshot of your power automate flow. @AlexGIS . @ZacharySutherby We are stuck on how to get the apply to each to write all the variables from a repeat to a row in excel. Each of these has a variable extracted. Any examples would be super helpful!

santamariaa_0-1686945392027.png

 

0 Kudos
NatalieSlayden
Occasional Contributor

@santamariaa were you able to sort this out? I am having similar issue

0 Kudos
santamariaa
Occasional Contributor

santamariaa_2-1695311349674.png

Insert an initiate variable and set the type to object.  Insert a compose action to gather data from the repeats & apply to each will be added automatically. Add a set variable action to the name of variable created earlier and set the value to the output from the compose action. Then add a row to the table action.

 

0 Kudos
LizanneRoxburgh
Emerging Contributor

HI all. I am struggling to get this set up correctly (i.e., have Power Automate populate two different Excel spreadsheets from a parent and child table (or repeat) in Survey123). Could anyone provide detailed step by step instructions? I'm having problems mostly with the child table. The parent table works, but does create duplicates. The flow currently looks like this:

LizanneRoxburgh_0-1714658026222.png

 

0 Kudos