cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dime2022
Helper I
Helper I

Sending Photo URL from Power Apps canvas app to Sharepoint List

We created a customized form in a PowerApps canvas app, that has a "Send data" button control below it which in turn is running an almost identical Patch code function to the one seen in the first post of the following thread.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Uploading-Image-Url-to-Sharepoint/td-p/13450...

 

We have successfully been able to test that Patch function with a Sharepoint List and are able to send the data for a datetime input control, a couple of two single-line text input controls and a multi-line text input control by using said Patch function to that list. However, we also have an image control which holds a photo that has been taken in a previous step with a camera control and are unable to sent that data to the list.

 

We have found that there are two solutions to this problem.

 

1. Send the photo using JSON in the Patch function.

2. Using Power Automate and Flow to do the same.

 

To keep things simple, we'd like to use the Patch function together with JSON. In the last post to the above link/thread, there is a link to another page from Warren Belz and his private blog but we're still a bit hazy around how to integrate that code into our Patch function.

 

Could anyone help out?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @dime2022 ,

The JSON to the list needs to be set to a multi-line text field as per this section

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @dime2022 ,

The JSON to the list needs to be set to a multi-line text field as per this section

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

Hi @WarrenBelz!

 

Thanks, we used your idea and made it work (although in a slightly different way). The Sharepoint List column is now populated with the JSON converted image data and results in a base64 format.

 

However, we are stuck with another issue in continuation to the above.

 

We now need to read the base64 data that we stored in the Sharepoint List and then convert it back to binary data in order to create a referenceable image file in Sharepoint (or do this in any other possible way). Ultimately, we'd like to reference that image in Microsoft Planner (either as a link or otherwise) in a text box (the reason being, that you mentioned earlier, that it isn't possible to read an image directly into Planner as an attachment such as a photo, URL etc.)

 

We tried to do this with a flow which is attached in this post, using base64ToBinary() in the very same. However, we're unable to get that referenceable image file as the flow throws the following error no matter our efforts.

 

Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.

 

We tested if the base64 data is actually valid and the images are displaying correctly when used in a converter. So there shouldn't be any issue with the data itself.

 

Could you (or anybody else for that sake) help us find the issue or give us a hint on how to solve this problem?

 

Thanks.

Hi @dime2022 ,

The only thing wrong with your flow base64 code used is you need to strip the header as per this blog section.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz!

 

Thanks for your input. This got us on the right way and into the right direction. 🙂👍

 

We actually got everything working now.

 

Great job and once more, thanks again for your efforts and time.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,747)