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 / Update URLs of images ...
Power Apps
Answered

Update URLs of images output to the SharePoint list (images converted to Base64 format).

(0) ShareShare
ReportReport
Posted on by 87

* I made a similar post before, but I guess my question wasn't clear enough, so I'm posting it again.

 

As shown in the figure below, we have an application that uses Gallery and Form.
Gallery is connected to a SharePoint list (Dataset name = 'SharePoint List').

What we want to achieve is to change the image and the URL.
The URL can be changed by typing it in the same way as the "Title", but since it is converted to Base64 format, it is not practical to rewrite it.

So I'm wondering if I can use the "Add picture control" to change the image and URL.

image.jpg

 

------------------------------------------------------------------------------------------

 

Using this expression, output the image to the SharePoint list as shown in the figure below.

 

Patch(
 'SharePoint List',
 Defaults('SharePoint List'),
 {
 Title:ImageName.Text,
 Image: Substitute(JSON(UploadedImage.Image,JSONFormat.IncludeBinaryData),"""","")
 }
);

 

スクリーンショット 2021-07-28 095817.jpg

 

I added the following expression to the OnSelect of "AddMediaButton2" to store the image URL converted to Base64 format in the collection (Listcollection3), and I was able to change the image and image URL in EditScreen.

 

ClearCollect(
 ListCollection3,
 Table(
 {ImageCode: Substitute(JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData),"""","")} 
 ) 
);

 

image2.jpg スクリーンショット 2021-07-28 153343.jpg

 

However, the images, URLs, and SharePoint list data displayed in the gallery will not change after you confirm the edit with the following formula.

 

SubmitForm(Form2);

 

スクリーンショット 2021-07-28 153700.jpg

------------------------------------------------------------------------------------------

 

Do you have any good ideas for changing the images or URLs?

 

Best regards,

Lopez

 

Categories:
I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at

    I'm a bit confused by all the galleries and forms.

     

    In your first picture, the top left gallery and top right gallery are the same, both connected to SharePoint?

    In which case you can use 

    ForAll(
    	Gallery1.AllItems,
    	Patch(
    		SharePointList,
    		ThisRecord,
    		{
    			Title: ThisRecord.Title,
    			Image: ThisRecord.Image
    		}
    	)
    )
  • Lopez_0090 Profile Picture
    87 on at

    @KvB1  

    Thank you so mach. 

    Sorry for the confusion. Yes, the top left gallery and the top right gallery are the same, and both are connected to SharePoint ('SharePoint List').

    * The upper left is the gallery before editing, and the upper right is the gallery after editing.

    * The images in the gallery on the upper right were created by pasting images to convey the image I wanted to achieve.

     

    Is this formula to be written instead of "SubmitForm(Form2)"?

    Where should I write this equation?

     

  • KvB1 Profile Picture
    1,596 on at

    You can use this on the OnSelect button, it doesn't have to be inside the gallery or form

  • Lopez_0090 Profile Picture
    87 on at

    @KvB1  

    I used this for the OnSelect button, but it doesn't change anything...

    Am I making a mistake here?

    図1.png

    スクリーンショット 2021-07-28 173549.jpg

     

    You will get an error like this.

    The requested operation is invalid. Server response: SharePoint List failed.

     

     

  • KvB1 Profile Picture
    1,596 on at

    I believe you are referring to the label and image control in your gallery right?

     

    ThisRecord.Title1 is just refering to that control. You can specify to the text in the control by using ThisRecord.Title1.Text

     

  • Lopez_0090 Profile Picture
    87 on at

    @KvB1 

    Thank you very much.

    I was able to resolve the error, but changing the Image and Title did not change the gallery display, so I tried the following formula.

    I was able to change the image and URL, but the whole gallery was changed in the same way.

     

    //SubmitForm(Form2);
    ForAll(
    	Gallery1.AllItems,
    	Patch(
    		'SharePoint List',
    		ThisRecord,
    		{
    			//Title: ThisRecord.Title1.Text,
     Title: DataCardValue13.Text,
    			//Image: ThisRecord.Image1.Image
     Image: First(ListCollection3).ImageCode
    		}
    	)
    )

     

     ã‚¹ã‚¯ãƒªãƒ¼ãƒ³ã‚·ãƒ§ãƒƒãƒˆ 2021-07-28 193600.jpg

    Is there something I need to do to change only what is selected in the gallery?

  • KvB1 Profile Picture
    1,596 on at

    Yes, the formula grabs every record in the Gallery1, and for every record, it will patch the relevant sharepoint record with the data you want it to. 

    In your formula you patch every record, with a static value. You need to use a value respective to the record. 

    The information that you want to use for patching to sharepoint, it is present somewhere in your gallery right?

  • Lopez_0090 Profile Picture
    87 on at

    @KvB1 

    There are two pieces of information that we want to use for the patch to sharepoint: the red frame (Title) and the yellow frame (a collection of images to be changed, converted to Base64).

     

    図3.png

     

    Is this what you mean when you say "it exists somewhere in the gallery?"

  • Verified answer
    KvB1 Profile Picture
    1,596 on at

    No, in the first picture in this thread, the topright picture, you have everything you want in the gallery right? 

    I also have to admit that forms are a big knowledge gap for me, so if someone has a 2nd opinion please do ^^

    Right now this is what I assume, please correct me:

    1 You have a gallery with SharePoint list in items property

    2 You click on the details, and then have Gallery1.Selected as DataSource property of the form
    3 Within the form you have a datacard for the title, and a sepperate collection with 1 row for the new imagecode

    You wish to patch the sharepoint record that you selected in gallery1 from the form, using DataCardValue13.Text for Title and First(ListCollection3).ImageCode for image

    Since its a form, there is probably a more elegant way to do this, but you could try:

     

     

    	Patch(
    		'SharePoint List',
    		Gallery1.Selected,
    		{
    			//Title: ThisRecord.Title1.Text,
     Title: DataCardValue13.Text,
    			//Image: ThisRecord.Image1.Image
     Image: First(ListCollection3).ImageCode
    		}
    	)

     

     

     

  • Lopez_0090 Profile Picture
    87 on at

    I apologize for my lack of understanding.
    I tried the formula and it worked!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard