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

Uploading image to sharepoint

I am following a tutorial to upload the base64 of a file uploaded from a PowerApp in to SharePoint using the create file automation. When I trigger the flow I get the following reason for failure:

 

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

 

I have checked the expression (base64ToBinary(triggerBody()['Createfile_FileContent'])) and its exactly how the tutorial shows

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @philkky12 :

I've made a test but did not encountered the problem you mentioned.Here is my test for your reference:

Do you want to upload the photo taken over the phone to the SharePoint library?

If so,I've made a test  for your reference:
1\Add a camera control(Camera1)

2\Create a flow('PowerAppV2->Compose,Createfile')

v-bofeng-msft_0-1623118596993.png

 

/*This flow's trigger is PowerAppV2*/

3\Add a button and set it's OnSelect property to:

Set(Thepic,JSON(Camera1.Photo,JSONFormat.IncludeBinaryData));
Set(Base64Only,Mid(Thepic,Find(",",Thepic)+1,Len(Thepic)-Find(",",Thepic)-1));
'PowerAppV2->Compose,Createfile'.Run("ThePic.jpg",Base64Only)

TheResult

v-bofeng-msft_1-1623118596725.png

 

I think these links will help you a lot:

Store photo on Sharepoint

Getting pics to SharePoint from PowerApps is getting easier…

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @philkky12 :

I've made a test but did not encountered the problem you mentioned.Here is my test for your reference:

Do you want to upload the photo taken over the phone to the SharePoint library?

If so,I've made a test  for your reference:
1\Add a camera control(Camera1)

2\Create a flow('PowerAppV2->Compose,Createfile')

v-bofeng-msft_0-1623118596993.png

 

/*This flow's trigger is PowerAppV2*/

3\Add a button and set it's OnSelect property to:

Set(Thepic,JSON(Camera1.Photo,JSONFormat.IncludeBinaryData));
Set(Base64Only,Mid(Thepic,Find(",",Thepic)+1,Len(Thepic)-Find(",",Thepic)-1));
'PowerAppV2->Compose,Createfile'.Run("ThePic.jpg",Base64Only)

TheResult

v-bofeng-msft_1-1623118596725.png

 

I think these links will help you a lot:

Store photo on Sharepoint

Getting pics to SharePoint from PowerApps is getting easier…

Best Regards,

Bof

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,648)