Power Automate - Upload Repeat Photos to SharePoint

606
3
Jump to solution
11-17-2021 10:10 AM
BattJones
New Contributor II

Hello, all.

I have a survey that has 2 different repeat tables (not nested) - 1 (Inspection Photos) with photos. I'm trying to get photos from the Inspection Photos repeat to upload to SharePoint by using Power Automate. However, I've been unable to get the actual photos to upload - only text or it fails entirely with an error stating the object needs to be an array. I've tried a number of different variations of 'Apply to each' and what the 'File Content' field for SharePoint is, but none have been successful.

I've attached an example of how it currently looks. I've previously looked at both of these posts for reference as well (https://community.esri.com/t5/arcgis-survey123-questions/finding-the-picture-url-in-power-automate-i... and https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-working-with/ba-p/...).

 

Unsure if I'm just getting the field names wrong (they don't fully display in Power Automate). Any assistance on how to get this to work would be greatly appreciated. Thank you!

1 Solution

Accepted Solutions
BattJones
New Contributor II

@DerrickWestoby - Thank you SO much! Your answer gave me enough to bridge the gap I was missing (HTTP GET and the right combination of Apply to each (Iterator in Integromat).

My final(ish) flow is attached as a screenshot and text below. I run into an error between Apply to each 4 and Apply to each 5 when there's a blank image, but I'll be modifying the Survey to resolve that issue. Otherwise, working as intended!

 

Apply to each (feature repeats RepeatName)

Apply to each (feature repeats RepeatName attachments ImageFieldName)

HTTP - GET (URI: feature repeats RepeatName attachments ImageFieldName url) and (Queries: token / token (from a Parse JSON earlier in the flow))

SharePoint - Create File (File Content: Body of HTTP - GET)

View solution in original post

3 Replies
DerrickWestoby
Occasional Contributor III

I'm sorry I can't help you on Power Automate specifically, but I can show you how I have it set up in Integromat if that helps.   It took me a bit to get this working in integromat as well.  Same setup as you, photos in a repeat. 

DerrickWestoby_0-1637264623732.png

 

The array I'm passing to the iterator is the repeat itself (field_observations)

DerrickWestoby_1-1637264672617.png

 

Then I run the scenario once by triggering the webhook with a submission, so that now I can see the structure for the next module.  Here's where I'm grabbing the URL using an HTTP GET module

DerrickWestoby_2-1637264730593.png

 

And uploading each photo to google drive, while renaming the photos. Note that in my scenario, I have to include the file extension when renaming.  

DerrickWestoby_3-1637264798402.png

 



 

BattJones
New Contributor II

@DerrickWestoby - Thank you SO much! Your answer gave me enough to bridge the gap I was missing (HTTP GET and the right combination of Apply to each (Iterator in Integromat).

My final(ish) flow is attached as a screenshot and text below. I run into an error between Apply to each 4 and Apply to each 5 when there's a blank image, but I'll be modifying the Survey to resolve that issue. Otherwise, working as intended!

 

Apply to each (feature repeats RepeatName)

Apply to each (feature repeats RepeatName attachments ImageFieldName)

HTTP - GET (URI: feature repeats RepeatName attachments ImageFieldName url) and (Queries: token / token (from a Parse JSON earlier in the flow))

SharePoint - Create File (File Content: Body of HTTP - GET)

DerrickWestoby
Occasional Contributor III

Welcome, and I'm glad it helped you! 

(Credit to  @IsmaelChivite and his awesome blog posts for teaching me how to do this in the first place)

0 Kudos