cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Assign values to image collection and assign to flow

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 ? 

11 REPLIES 11
Highlighted
Community Support
Community Support

Re: Assign values to image collection and assign to flow

Hi @langsem :

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

Highlighted
Helper V
Helper V

Re: Assign values to image collection and assign to flow

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. 

Highlighted
Helper V
Helper V

Re: Assign values to image collection and assign to flow

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 

Highlighted
Community Support
Community Support

Re: Assign values to image collection and assign to flow

Hi @langsem :

Could you describe your app and flow settings in detail?

Could you provide some screenshots?

Best Regards,

Bof

Highlighted
Helper V
Helper V

Re: Assign values to image collection and assign to flow

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. 

Highlighted
Community Support
Community Support

Re: Assign values to image collection and assign to flow

Hi @langsem:

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

Highlighted
Helper V
Helper V

Re: Assign values to image collection and assign to flow

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 

Highlighted
Community Support
Community Support

Re: Assign values to image collection and assign to flow

Hi @langsem :

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

Highlighted
Helper V
Helper V

Re: Assign values to image collection and assign to flow

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,059)