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 / Adding Dynamic Gallery...
Power Apps
Answered

Adding Dynamic Gallery Controls

(0) ShareShare
ReportReport
Posted on by 16

Hello everyone,

 

Our App has a Survey type of layout where Questions are stored in a SP list and corresponding Answers are stored in another. I want to display  Questions via a Gallery and get the answers back by dynamically showing the controls. For instance, add a DatePicker, Add Media, Radio Button and Text Label on top of each other and group them and then under the Visible property show the corresponding control based on the question Type. So, in the Visible property, I will add an expression to check the question type and if it is Bool, use Radio button etc.

 

Now, I am having an issue with the pictures. When I have more than 1 image captured via the Add Media button, how do I loop though the uploaded images and upload them to a Sharepoint Doc library? I was thinking to get the SP link back and use it for the image questions.

 

Any suggestions please?

Categories:
I have the same question (0)
  • PA_NewUser Profile Picture
    16 on at

    Attached is the layout of the app to get an idea..

    SurveyAppQuestions_Layout.jpg
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @PA_NewUser ,

    Do you want to loop the uploaded image data from your canvas app back to your SP Library?

     

    Based on the needs that you mentioned, I afraid that PowerApps could not achieve your needs. Currently, there is no direct way to upload picture file from canvas app to SP Library.

    As an alternative solution, I think the combination of Power Apps and Power Automate flow could achieve your needs. I assume that you list all your question records in a Gallery, and each question has a QuestionID.

    Within your canvas app, you need to collect these captured images into a collection along with Picture name, and QuestionID. Then convert the collection table as a JSON String, then pass the JSON String to your flow. Within your Power Automate flow, convert the passed JSON String into a actual JSON table using json expression, then apply a "Apply to each" action to this converted JSON Table, within the "Apply to each" action, you could add a "Create file" action of SharePoint connector to create file based on the passed JSON string.

     

    Within your canvas app, you could collect your image collection as below:

    11.JPG

    On your side, you may type the following formula:

    Collect(
     colPic, 
     {
     PicContent: Substitute(JSON(UploadedImage1.Image, JSONFormat.IncludeBinaryData), """", ""), 
     PicName: ThisItem.QuestionID & "_" & AddMediaButton1.FileName
     }
    )

     

    When you want to pass the colPic collection back to your flow, you need to try the following formula:

    'Flow Name'.Run(JSON(colPic, JSONFormat.IncludeBinaryData))

     

    Your flow's configuration may look like below:

    12.JPG

     

     

    Please check and see if the following video would help in your scenario:

    https://www.youtube.com/watch?v=kQVYid1p_vA

    https://www.youtube.com/watch?v=UYK7yruBHDM

    https://www.youtube.com/watch?v=ZXWyDgDEHPo

     

    Best regards,

  • PA_NewUser Profile Picture
    16 on at

    Worked like charm. Thanks for the super quick reply.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard