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

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,408)