Hello,
I am creating a Microsoft Power Automate Flow to take my Survey123 submissions and create new line items in my Microsoft List.
In this specific Survey123, I have a field for replicate number, which if the answer is >1, will require a repeated replicate name field. The number of repeats of the replicate name field corresponds to the numeric value entered in the replicate number field.
As it stands in my flow, the number of line items created is related to the number of replicates. All is running smoothly except, when I try to submit a survey response with only one replicate, the flow fails.
I know that this has something to do with the "Select an output from the previous step" section in the apply to each section of the flow. However, if I change this dynamic content from the repeat replicate names field, the flow continues to fail for single replicates, or will not import replicate names for more than 2 replicates.
How do I resolve my issue to have the correct number of line items for the number of replicates with the names imported and be able to have the flow run with only one replicate too?
Below are screen shots of my flow as well as the failed error.
Solved! Go to Solution.
Had a look. Didn't clue in right away, but seeing it "in person" helped. The issue is that the repeat only appears when a number >1 is entered. That means the user can enter 1, submit the form, and your described Power Automate issue will occur.
This being the case, you will need to test for the repeat and then branch your flow accordingly. You can select the repeat in Power Automate:
And then use that in a Condition similar to this:
When the repeat is empty, it will do one thing, and when it contains data, it will do something else.
Beyond that, here are a couple template things, in case you didn't already know (I attached the XLSX):
From the screen shot, your repeat doesn't exist under this scenario. Are you able to include your XLSX so I can get a better idea of the workflow?
Ideally, your repeat in S123 will always exist and will always have at least one record (aka, be required).
If, when you have one item, the repeat doesn't exist, then you will need a condition within Power Automate to detect for a null repeat, and then do something else.
Hello here are the screenshots of the XLSX.
A quick glance at the screen shots seems to indicate that:
Given that, the ${saminfo_repinfo} array should theoretically never be null, meaning your flow should at least get beyond that point. But, that obviously isn't the case. If you could attach the actual XLSX, I could recreate this.
(Side note, but it looks like you can just make ${saminfo_repinfo} required rather than conditionally required)
Had a look. Didn't clue in right away, but seeing it "in person" helped. The issue is that the repeat only appears when a number >1 is entered. That means the user can enter 1, submit the form, and your described Power Automate issue will occur.
This being the case, you will need to test for the repeat and then branch your flow accordingly. You can select the repeat in Power Automate:
And then use that in a Condition similar to this:
When the repeat is empty, it will do one thing, and when it contains data, it will do something else.
Beyond that, here are a couple template things, in case you didn't already know (I attached the XLSX):