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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add Media control and ...
Power Apps
Unanswered

Add Media control and Camera control (Convert to Binary issue)

(0) ShareShare
ReportReport
Posted on by 110

Hi everyone,

I am trying to store 2 types of photos. From Camera control and from Add Media control.

If user is online, then the submit form sends the photos to attachment column.

Camera Control On select:

 

Collect(
 ColImages,
 {
 DisplayName: Label6_4.Text & ".jpg",
 Id: Label6_4.Text,
 Value: Camera1_4.Photo
 }
 );

 

 

   Add Media control On Select:

 

Collect(
 ColImages,
 {
 DisplayName: "Uploaded" & Label6_4.Text & ".jpg",
 Id: "Uploaded" & Label6_4.Text & ".jpg",
 Value: UploadedImage3_4.Image
 }
 ); 

 

 

If user is offline, pictures from both control are stored in a collection and then sent to a library.

The Camera control images are working fine, the images are created in the library (via Flows).

However, the images from the Add Media control are failing (Convert to Binary image):

 

InvalidTemplate. Unable to process template language expressions in action 'Convert_to_binary_image' inputs at line '1' and column '16011': 'The template language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI. The provided value 'appres://blobmanager/bf69506ef8284392921febb1982d43d5/1' was not formatted correctly. Please see https://aka.ms/logicexpressions#dataUriToBinary for usage details.'.

 

AOZ_0-1633939435050.png

 

Any idea if there is a difference between these 2 controls?

 

Categories:
I have the same question (0)
  • Anousha Profile Picture
    34 on at

    Hey,

    For the Add Media control you can use 

    JSON(
    UploadedImage3_4.Image,
    JSONFormat.IncludeBinaryData
    )

  • AOZ Profile Picture
    110 on at

    Hi @Anousha 

    I tried the following as you said:

    Collect(
     ColImages,
     {
     DisplayName: "Uploaded" & Label6_4.Text & ".jpg",
     Id: "Uploaded" & Label6_4.Text & ".jpg",
     Value: JSON(UploadedImage3_4.Image,JSONFormat.IncludeBinaryData)
     }
     );

    Image appears blank in collection gallery:

    AOZ_0-1634108763370.png

     

    Here is the collection:

    AOZ_1-1634108784917.png

     

  • Anousha Profile Picture
    34 on at

    Hi there, It should work if you strip out the binary code from that Value, so you don't need to be storing that part at the beginning with data image jpeg e.t.c

  • AOZ Profile Picture
    110 on at

    hi,

    As i am quite new...could you write it up for me?

    Also, the naming of the image is important...

     

  • Anousha Profile Picture
    34 on at

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Blob-to-Image-in-PowerApps/m-p/365144 this previous answer should be able to help you out with what you need to achieve

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard