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 Automate / Powerapps - Upload ima...
Power Automate
Answered

Powerapps - Upload image to sharepoint libary thanks to power automate

(0) ShareShare
ReportReport
Posted on by 50

Hi evryone,

 

I want to upload image to sharepoint library, but I can't watch it on sharepoint because sharepoint is not supported on sharepoint.

JonasBDM_2-1646400140726.png

 

Someone can help me please ? 

 

To do this, I make this flow : 

JonasBDM_0-1646399487438.png

 

Formula : 

Convert to binary image : triggerBody()['Createfile_FileContent']

Create file / Nom de fichier (File name) : triggerBody()['CreatefileFilename']

 

In addition on power power, I do this : 

 

My screen :

JonasBDM_1-1646399992712.png

 

The button code :

Set(LeNom;
User().FullName & "_" &
Year(DatePicker1_1.SelectedDate) & "-" &
Month(DatePicker1_1.SelectedDate) & "-" &
Day(DatePicker1_1.SelectedDate) & "-" &
lstClient.Selected.Result & "_" &
lstMission.Selected.Result & "_" &
DerId
);;
Set(LeMail; User().Email);;

ChargerunephotodansSharePointàpartirdePowerApps.Run(AddMediaButton1.FileName ;JSON(UploadedImage1.Image;JSONFormat.IncludeBinaryData);LeMail);;

 

Thanks in advance for your help !

 

JL

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @JonasBDM ,

     

    The whole process you could refer to below video:

    https://www.youtube.com/watch?v=ovLIwnj6QjU

     

    I see you may have missed the function in convert to binary image:

    Convert to binary image:

    dataUriToBinary(triggerBody()['Createfile_FileContent'])

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • JonasBDM Profile Picture
    50 on at

    Hi @v-jefferni ,

     

    Thank for your help! 


    I tried this formula, but it doesn't work... When I use it, Power Automate tells me that "Unable to process template language expressions in the "Convert_to_binary_image" action entries in row "0" and column "0": "The template language function 'dataUriToBinary' requires its parameter to be formatted as a valid data URI. The value provided : Unable to process template language expressions in the "Convert_to_binary_image" action entries in row "0" and column "0": "The template language function 'dataUriToBinary' requires its parameter to be formatted as a valid data URI. The value provided ... "

    JonasBDM_1-1646820979412.png

     

    Do you have another idea ? 

     

    Best revards,

    JL

  • v-jefferni Profile Picture
    on at

    Hi @JonasBDM ,

     

    How will you upload the images to PowerApps? Which control are you using, is it an AddPicture control?

     

    If so, please refer to below blog:

    https://www.matthewdevaney.com/power-apps-add-picture-control-and-save-to-sharepoint-library/

     

    Firstly, I think you have missed the file extension in your flow create file file name parameter input. Secondly, if you are using AddPicture control, you can use the image directly, no need to convert to JSON format. 

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Verified answer
    JonasBDM Profile Picture
    50 on at

    @v-jefferni ,

     

    Thank for your help. I use a AddPicture Control. I tested the solution in your blog but it doesn't work for me ... 

     

    After some research, I found a solution with shane young : (562) Power Apps Camera Control, Add Picture Control, and Optimize Image for Upload - YouTube

     

    I changed my code in PowerApps : 

    Set(LeNom;
    User().FullName & "_" &
    Year(DatePicker1_1.SelectedDate) & "-" &
    Month(DatePicker1_1.SelectedDate) & "-" &
    Day(DatePicker1_1.SelectedDate) & "-" &
    lstClient.Selected.Result & "_" &
    lstMission.Selected.Result & "_" &
    DerId & "-Media.jpg"
    );;
    Set(LeMail; User().Email);;
    
    Set(varJSON;JSON(UploadedImage1.Image; IncludeBinaryData));;
    Set(varTrimmed; Mid(varJSON;2;Len(varJSON)-2));;
    
    ChargerunephotodansSharePointàpartirdePowerApps.Run(LeNom;varTrimmed;LeMail)

     

    And in Power Automate, I changed the "Convert to binary image" code as you advised me above. 

     

    Thank for your help again.

     

    Best regards,

     

    JL

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard