web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using ForAll to run a ...
Power Apps
Answered

Using ForAll to run a Flow and pass in parameters from a collection?

(0) ShareShare
ReportReport
Posted on by 1,207
I want to bulk upload images by either passing a collection to flow or use ForAll to run the flow for each record.
 
Something along the lines of:
 
ForAll(
colArticleImages,
ImageUpload.Run(FileName,ImageRaw).ImageUrl
)
 
FileName and ImageRaw are columns in the colArticleImages collection.
 
I would then like to add each ImageUrl returned from flow to a collection.
 
I was wondering about the best method for achieving this and if it is even possible.
Categories:
I have the same question (0)
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    @Digital 

    Could you share more details and screenshots about the flow and app?

    I have made a test. bulk upload image to SP documents, and return the File ID. Hope this help.

    1. check the flow steps

    Snipaste_2020-01-21_11-38-56.png

    2. add an Add Picture control, set OnSelect property of AddMediaButton1 as below, all JSONs with ImageName and Image are saved into the collection.

     

    Collect(MyCollection,{JS:JSON({FileName:AddMediaButton1.FileName,File:UploadedImage1.Image},JSONFormat.IncludeBinaryData)})

     

    3. add a button, set OnSelect as below, save the return ID into the collection.

     

    ClearCollect(ReturnID,ForAll(MyCollection,SPdoc.Run(JS).fileid))

     

     Snipaste_2020-01-21_11-41-19.png

    Snipaste_2020-01-21_11-45-29.png

    Sik

  • Digital Profile Picture
    1,207 on at

    @v-siky-msft ,

     

    Thank you this will be very useful. It's similar to what I've been trying but the flow was failing as it had a problem with the JSON I was sending. How did you define your JSON schema? I ran once and used the output from initialize variable step to generate from sample but Flow was complaining. I will try again using your method.

     

    My PowerApp uses a gallery to display 4 AddMedia controls. These are populated if a user selects an existing record in my gallery, otherwise they display a generic image. I am also using ForAll to run flow for each image in my collection. I was hoping Flow could return JSON that I could parse into a collection in PowerApps, but I believe this isn't possible at this time.

     

    Thanks again, I'll mark your answer as the accepted solution. 

     

     

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @Digital 

    My JSON schema as follows

    {
        "type": "object",
        "properties": {
            "File": {
                "type": "string"
            },
            "FileName": {
                "type": "string"
            }
        }
    }

    It is generated from the sample:

    {"File":"Test",
    "FileName":"Test"}
    Sik

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard