web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / New records for a picture
Power Apps
Answered

New records for a picture

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I am trying to use "AddMediaButton" to put some picture in my Excel.

My OnSelect to valid the picture is :

"Patch(Liste;Defaults(Liste);{Photo :AddMediaButton1.Media};{ID:Value(Max(Liste; ID))});; Navigate(BrowseScreen1)"

It's create a new record instead of modifie the link of my picture in the row "photo"...

Do you have an idea?..

Many thanks

Categories:
  • JayMagness Profile Picture
    1,663 on at

    Hi,

     

    I recommend making life easy and use SharePoint and add them as attachment

     

    If you want you can send me an email jay@research-nest.com and I will help you via teams

     

    Jay

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @JBpowerapps ,

    Do you want to edit photo in one existing record?

    Firstly , I suggest you know more about the Patch function.

    Patch function's syntax:

    1)create a new record

    Patch(table,Defaults(table),{...})

    2)edit an existing record

    Patch(table,item to modify,{...})

     

    In your issue, you should use the second formula, not using Defaults(...).

     

    Secondly, to upload image from powerapps to excel, you need to name that image field like this:

    fieldname[image]

     

    Thirdly, the updating formula should be like this:

    Patch(Liste;
     LookUp(Liste,ID=Value(Max(Liste; ID)));
     {Photo :AddMediaButton1.Media}
     );; Navigate(BrowseScreen1)

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi 

     

    Thanks for your answer,

    I don't understand which line code I should use

    Patch(Liste;{Photo};{Photo:AddMediaButton1.Media};{ID:record.ID});; Navigate(BrowseScreen1) 

    or

     Patch(Liste;LookUp(Liste,ID=Value(Max(Liste; ID)));{Photo :AddMediaButton1.Media});; Navigate(BrowseScreen1)

     

    both are not working...

    Thanks for your help

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @JBpowerapps ,

    1)The syntax is:
    Patch(table,item to modify,{...})

    The second parameter should be the record that you want to update in your list.

    Usually we use First(Filter()) or LookUp() function to get that record.

    So this part "LookUp(Liste,ID=Value(Max(Liste; ID))" is right.

     

    2)Please tell me the data type of your photo field.

    If it is picture type, I'm afraid it's read-only in powerapps. You can not update picture data type in powerapps.

    If it is hyperlink type, you could update this field in powerapps.

    However, you need to update this field will url link, not "AddMediaButton1.Media".

    "AddMediaButton1.Media" is just a blob data, which is not a url.

    You have two solutions:

    • upload this local photo to cloud, update this field with url
    Patch(Liste;LookUp(Liste,ID=Value(Max(Liste; ID)));{Photo :url});; Navigate(BrowseScreen1)
    //fill in picture url
    • still want to update by using addpictue button. Then you need to create a flow, which use the picture uploaded to addpictue button to create a file and save in sharepoint library, then generate a link for this file, use this link to update this field.

    Here's a blog about how to create this kind of flow in details for your reference:
    http://www.cleverworkarounds.com/2019/06/08/getting-pics-to-sharepoint-from-powerapps-is-getting-easier/

     

    Best regards,

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard