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 picture button imp...
Power Apps
Answered

Add picture button import image and save that image in OneDrive with PowerAutomate flow

(0) ShareShare
ReportReport
Posted on by 12

Hi all, 

 

I'm trying to import an image with 'add picture' button, and save imported image to OneDrive. But my issue is, i can't understand how to do that, because link image imported is blobmanager and when i try to create a file into OneDrive to save my picture it's doesn't work, someone knows how to use Add picture button saving image into OneDrive?

 

Poloni_0-1670935598586.png

 

Poloni_1-1670935641939.png

 

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Poloni 

    I found this tutorial online.
    It uses the Create SharePoint file action in the flow but I expect the OneDrive action to be quite similar.

    Should you prefer a video format tutorial, YouTube channels such as Shane Young or Reza Dorrani have video's on uploading pictures as well. I would highly recommend watching one of those video's because there are quite a few steps involved.

    Note: If you want to import/upload a picture (not take one) via the app, to my knowledge, you will need to use a workaround (Attachment Control not the Image control). The above mentioned YouTube channels also have video's on this.

    Would it be possible to check if this solves your questions?
    Thanks!

  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @Poloni 

     

    For Power Apps Trigger Upload button, you'll need this code:

    cha_cha_1-1670943229070.png

    Set(varImageJSON,JSON(AddMediaButton1.Media,JSONFormat.IncludeBinaryData));
    Set(prepImage,If(
     Right(AddMediaButton1.FileName, 3) = "jpg",
     Mid(varImageJSON, 25, Len(varImageJSON) - 25),
     Right(AddMediaButton1.FileName, 3) = "png",
     Mid(varImageJSON, 24, Len(varImageJSON) - 24)
    );
    'PowerApp->Createfile'.Run(prepImage,AddMediaButton1.FileName)
    

     

     

    For Automate, you need to wrap the content with base64ToBinary function.

    cha_cha_0-1670943086776.png

     

     

     


      ✔️
    Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

     

      🔗
    🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 
  • Poloni Profile Picture
    12 on at

    Thank you very much @cha_cha! Helps me a lot! This is exactly what I was looking for.

  • Poloni Profile Picture
    12 on at

    @LaurensM Thank you for your suggestion! I have another app that i'll need to attach an file and export them, your comment will helps me with that problem, thank you!

  • Poloni Profile Picture
    12 on at

    Poloni_1-1671117685008.png

     

     @cha_cha sometimes flow returns this error, do you know why?

     

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