Select to view content in your preferred language

Weird PowerAutomate behavior

262
2
a month ago
AmyAlford1
Occasional Contributor

I'm using the suggested flow here (https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-working-with/ba-p/...) to upload attachments to a OneDrive Folder. I'm getting a weird behavior, however. When a user submits the response they are given the option to upload multiple files of type .csv, .xls, .xlsx, or .pdf. When I submit multiple documents of the same or different type, or just one document, the flow runs fine and the documents are saved in the OneDrive destination. But when others do it, the survey response is collected, the attachments are stored fine in the feature service, but they do not download properly to OneDrive. The files are all of size 1KB and are empty (or unsupported) when opened. I have to then go to the Survey123 manage website and resubmit each record to get the attachment properly stored in OneDrive. I get a ping email each time, so I know to check it. But when multiple records come in at odd hours, it defeats the purpose of the webhook.

0 Kudos
2 Replies
TylerGraham2
Frequent Contributor

Can you share a screenshot of your Power Automate flow? 

I've got a few ideas. 

I had an issue with using Power Automate to build and write data to a spreadsheet.  It took time for the "add row into a table" action to complete. I was getting empty spreadsheets or partial spreadsheets until I added a Delay action after that step to give everything time to write until it grabbed the file content.  

I'd wonder if it is trying to grab the file data before it is completely uploaded or if it is trying to write too much at once to the one drive location. I'd try adding a delay after the flow's trigger, experiment with 1-5 minutes and see if that resolves it. If that doesn't work, try adding a delay after the create file action in the apply each to give it some time to write the file.  

Another idea would be to check the users permissions for the OneDrive destination folder.  My understanding of connections in power automate is that they use the flow's creator's credentials, or ones they entered.  However, maybe being a different user could be causing issues if they don't normally have permissions to access the OneDrive location.  

I'd also try creating a new flow or adding a parallel action to the existing one for testing that emails you the attachments. You could see if the issue appears when emailing vs writing to OneDrive.  That could give you a clue as to where the problem starts.  

AmyAlford1
Occasional Contributor

 I have other flows that write rows to excel tables, and there is a delay for sure. However, with this particular flow, I'm not sure that delay is the issue because when I manually trigger or enter a response myself, the writing of the attachment to OneDrive is immediate. 

But I think you are right...I wonder if it is a write permission thing? I'll have to do some more testing. I only have a handful of private users that are submitting records, so adding them to the folder's permission wouldn't be too much of a lift. Thanks for the feedback! It's helpful.

0 Kudos