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 / Save Image File in a O...
Power Apps
Suggested Answer

Save Image File in a OneDrive folder with Power Apps

(3) ShareShare
ReportReport
Posted on by 4
First of All, I'm not very good at English, So please excuse any mistakes.
 
2 years ago, I created a Power App to Save Images file in a OneDrive folder.
It worked well on both PC and smartphone, But about 1 year ago, it suddenly stopped working on smartphones.
 
Here's how I set up the Power App :
 
1. I created a Excel file named "apptest.xlsx".
2. In the Excel file, I created a table named "test_table" with columns "txt1" and "pic1[image]".
3. In OneDrive, I created a folder named "apptest_images".
4. I created a Power App and linked it to the Excel file "apptest.xlsx".
5. And I added "TextInput1", "AddMediaWithimage1" and a Button.
6. In the Button's [OnSelect] property, I used the follwing code.
    "Patch(test_table, {txt1:TextInput1.Text, pic1:AddMediaButton1.Media})"
 
On a PC, txt1 and pic1[image] (the image address in OneDrive) are entered correctly in Excel, and the Image is saved correctly in the OneDrive folder.
On Smart Phone, txt1 and pic1[image] are entered correctly in Excel, BUT the Image is saved in a BROKEN STATE (0 KB) in OneDrive folder.
  (This problem occurs on all types of Smartphones.)
 
How can I fix this problem ?
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    How are you saving the image to OneDrive? Are you using a flow?
    Images are now being managed differently on mobile vs browser where one still uses the Base64 encoding while the other uses a blob method where a link is provided to the flow,
  • w.p Profile Picture
    8,339 Super User 2025 Season 2 on at

    Can you please share app screenshots to help identify the issue.
    Currently, I'm unsure about the relationship between the Excel and the image.

  • Suggested answer
    w.p Profile Picture
    8,339 Super User 2025 Season 2 on at
    can you try replace Media with Image.
    "Patch(test_table, {txt1:TextInput1.Text, pic1:AddMediaButton1.Image})"
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Not quite sure how you upload the image ?
    did you use powerautemate within the app ?
  • CU11040722-0 Profile Picture
    4 on at
    Sorry, I didn't know how to reply, so my response is late.
    (Actually, I'm not sure if I'm writing this correctly.)
     
        I'm still a beginner, so I'm not sure how to respond.
        I haven't used PowerAutomate, and I don't know how to use it.
     
        It's certain that it works on the PC, but doesn't work on the smartphone.
        I'm curious why it works on the PC, but not on the smartphone.
     
        ○ Patch(test_table, {txt1:TextInput1.Text, pic1:AddMediaButton1.Image}) → It doesn't working.
     
        ○ The relationship between the Excel and the image
            I'm not sure how to show the relationshop.
            When I upload a Image on PC, Column "pic1[image]" .\apptest_images\5911ae48cba04fe4ba92213f0cdcdd08.jpg (File name is Random) 
                                                              Column "__PowerAppsld__" (It was generated automatically.) sRFHbZHsh68 (It's Random too)
     
        I made it two years ago by searching around the internet, but I didn't understand the principles behind it.
     
        I made it by searching around the internet, but I didn't understand the principles behind it.
        I haven't used Flow, and I don't know how to use it.
     
        If your answer is correct, how can I resolve this issue?
     
    ※ I found similar method on this site : https://www.eliostruyf.com/uploading-images-to-your-onedrive-with-powerapps/
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
     
    I think you used OneDrive connector ( I thought Excel Online connector).
    Anyway, you can try to update your code as below:
    Patch(
        test_table,
        Defaults(test_table),
        {
            txt1: TextInput1.Text,
            pic1: UploadedImage1.Image  //AddMediaButton1.Media only works for PC.
        }
    )
     
    Screen shot shows my excel file update, with correct info, pic points to my onedrive.
     
    And the problem is, after I changed a little of the UI, published it again, sudenly it just stopped working (same as your app).
    If anyone never tried it before and interested, they can try.

     
  • w.p Profile Picture
    8,339 Super User 2025 Season 2 on at
    This is a workaround, not the proper way to implement the app, and it could break at any time.
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    I will add something here that may alleviate some of the confusion. Firstly, you cannot save an image (binary content) to a field in an Excel Table - it will be "broken" as you have noted, so patching the "raw" image content simply will not work.
    What can be done however is patching a JSON string conversion of the image - just be aware that large images may exceed the 32767 character Excel cell limit. Also note to use the UploadedImage rather than the AddMediaButton.
    With(
       {
          _Image: Substitute(
             JSON(
                UploadedImage1.Image,
                JSONFormat.IgnoreBinaryData
             ),
             """",
             ""
          )
       },
       Patch(
          test_table,
          {
             txt1:TextInput1.Text,
             pic1: _Image
          }
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   

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