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 / How to I change the Di...
Power Apps
Unanswered

How to I change the DisplayName of an image attachment by simply clicking on it in Power Apps?

(1) ShareShare
ReportReport
Posted on by 42

In my Power App I have a gallery of image attachments that is pulled from a Sharepoint list. I want the user to be able to change the name of an image attachment to "TestImage" just by clicking on the image name as you see in the screenshot below. I tried achieving this by setting the DisplayName to "TestImage" in the OnSelect code of the image label. But as you can see, that is causing an invalid arguments error. How do I allow the user to change the name of an image attachment by simply clicking on it in Power Apps?

 

Set(ThisItem.DisplayName,"TestImage");

 

BeckTableGalleryImageDisplayName.jpg

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,417 Most Valuable Professional on at

    Hi @powaya ,

    You cannot do this - it is the name of the underlying file (which is actually stored in OneDrive).

     

    Please click Accept as solution 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 Thumbs Up.

    Visit my blog Practical Power Apps

  • powaya Profile Picture
    42 on at
    • @WarrenBelz  But the underlying file attachment is stored in Sharepoint, not OneDrive, and I was able to give the attachment an initial name using PowerApps, so shouldn't there be a way to rename the attachment too?
  • WarrenBelz Profile Picture
    156,417 Most Valuable Professional on at

    @powaya ,

    The file is actually in OneDrive (but that is probably not relevant) with a List attachment or are your talking about a SharePoint Library here?

    An Attachment Control (which is the only way in Power Apps to add or delete attachments) does not have a rename function.  Also you did not give it an initial name - it would have taken the name of the file uploaded. Power Automate can add or delete attachments, but not rename them.

    If this is a Library, you can do it in a Grid View in SharePoint, but any attempt to Patch it from Power Apps states the field is read-only.

     

    Please click Accept as solution 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 Thumbs Up.

    Visit my blog Practical Power Apps

  • powaya Profile Picture
    42 on at

    @WarrenBelz Yes the image file is uploaded to a Sharepoint List as an attachment to one of the rows in the list. The power apps code that is used to add the attachment is below. This code allows the power app user to enter a custom image name into a text box input, and the file takes that DisplayName. So I'm wondering, if power apps can assign a DisplayName to an attachment, why can't it rename an attachment as well? That seems kind of odd no?

     

    Collect(
     colImages,
     {
     DisplayName: ImageTextInput.Text & ".jpg",
     Id: ImageTextInput.Text & ".jpg",
     Value: Camera1.Photo
     }
    );

     

  • WarrenBelz Profile Picture
    156,417 Most Valuable Professional on at

    @powaya ,

    Firstly, that code does not attach anything to a List - it is putting the images from the camera in a collection. I assume you have a Flow that runs after that and attaches the items to the desired List record. You did not mention a Camera image before and I naturally assumed you used an attachment control (and therefore no Flow involved), however back to your question - you cannot rename attachments once they are stored on a list item.

     

    Please click Accept as solution 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 Thumbs Up.

    Visit my blog Practical Power Apps

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard