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 / Assign values to image...
Power Apps
Unanswered

Assign values to image collection and assign to flow

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello i have an app where i take some images, that i am later sending with a rest api trough Power automation. 
I am wondering how i can assign the following to the images. Name: String, Base64: imageString, Timestamp: String
There are 6 images so i assume it will be in a collection. How can i assign those values to each image, then extract the information on each image in the flow before i send it off ? 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous :

    Could you tell me:

    • Do you want to pass the image, image name, and time in the collection to flow?

    If so, you need to use the JSON function in the app to convert the collection into a JSON string, then pass it to flow and then parse it in flow.I've made a test for your reference(Reference article😞

    1. Add the “Add picture control” to a screen and set the AddMediaButton component to add the photo and a random filename to a collection.

     

    Collect(pics, { Pic: UploadedImage1.Image, Name: Rand() & ".jpg",Time:Now()})

     

    1.jpg

     2. Add a button to the screen and create a flow from it using the Action menu.

    2.JPG

    mark1:

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "Name": {
     "type": "string"
     },
     "Pic": {
     "type": "string"
     },
     "Time": {
     "type": "string"
     }
     },
     "required": [
     "Name",
     "Pic",
     "Time"
     ]
     }
    }

    mark2:

    decodeDataUri(item()['Pic'])

    3. Add a button and set it's OnSlelect property to:

    Set(stuff,JSON(pics,JSONFormat.IncludeBinaryData));
    '0921'.Run(stuff) /*'0921' is my flow*/

    Judging from the running results of flow, the data in the collection has been successfully obtained.

    22.gif

    4.JPG

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    THanks for the response! I will defently have a look. Yes i assume i have to use a Collection, because i am having 6 images that each needs to be uploaded, but i also have 2 strings, but i think it will be easy to add it to the body for upload. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Got this on the http post. 
    InvalidTemplate. Unable to process template language expressions in action 'HTTP' inputs at line '1' and column '2313': 'The template language function 'decodeDataUri' expects its parameter to be formatted as a valid data URI. The provided value 'appres://blobmanager/bc3334eb064d436eb98249c7e75ce162/1' was not formatted correctly. Please see https://aka.ms/logicexpressions#decodeDataUri for usage details.'.

    Any idea ? Its targeting the image itself 

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

    Hi @Anonymous :

    Could you describe your app and flow settings in detail?

    Could you provide some screenshots?

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi so i have an app that has a qr scanner. I scan a qr code and from the code i get 3 text values. 

    I then take some images and saves them in a collection with some values that i have set.

    In the flow i then performs a post request to a webapi( have not made this work, i assume i need a gateaway as the db are on a local with azure ) i then post the images in a for each with the value i have. 

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

    Hi @Anonymous:

    Do you want to send these 3 text values and some pictures to flow?

    About Pictures:

    You can directly adopt the plan I provided before.

    About Text:

    I suggest you create three string variables in flow, and use "Ask in PowerApps" for their values.

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have all the values i need, struggling With the actual push. Think i need to setup a gateaway and Connect the gateaway to flow. No idea how this its done 

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

    Hi @Anonymous :

    I made a test and it worked well.I suggest you create some variables in flow to store the strings passed in powerapps, and then call these variables directly in flow.

    1.jpg2.JPG3.JPG4.JPG44.gif

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i have this alrdy. i cant make the http post rerquest work. as the database its a custom local web api

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

    Hi @Anonymous :

       My method converts the image file into a binary format. If you want to get the URL of the image, I suggest that you first store these images in the SharePoint library or OneDrive in flow, and then get their URL.

    Best Regards,

    Bof

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard