Showing results for 
Search instead for 
Did you mean: 
Post Prodigy
Post Prodigy

Displaying image using 64base


I have a ticket system application where they can add a picture. This picture gets saved to my SharePoint list using this code: 

       'Foto''s Manco App',
       Defaults('Foto''s Manco App'),
       {Title: DataCardValue12.Text & " " & DataCardValue24.Text,
         ImageData: Substitute(JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData),"""","")

 It looks like this:

I use: "AddMediaButton1.Media" to get the picture into the "UploadedImage1"

I then made a formula that would display the image but this does not seem to work anymore. 

LookUp('Foto''s Manco App', Title= DataCardValue12.Text & " " & DataCardValue24.Text, ImageData)

I used this formula instead of "AddMediaButton1.Media", this code would check if there is a picture in the database, if there is not, get the picture using "AddMediaButton1.Media"


If(LookUp('Foto''s Manco App', Title= DataCardValue12.Text & " " & DataCardValue24.Text, ImageData)= "", AddMediaButton1.Media, LookUp('Foto''s Manco App', Title= DataCardValue12.Text & " " & DataCardValue24.Text, ImageData))


How could I do this?



Hi @TimoMigchielsen :

The following are my detailed steps:

My data source:MyPhoto


Photo-mutiple lines of text

1\add a form(Form2);









2\photo data card



var /*Var is my custom variable*/


3\add a addpicture control into photo data card



If(IsBlank(AddMediaButton1.Media), If(IsBlank(ThisItem.Photo),SampleImage,ThisItem.Photo), AddMediaButton1.Media)


4\Add a Button:






Best Regards,



I am not using a gallery to show the pictures. I am using a lookup formula for that and because of that, it will always show the first picture that has been made with that name. 

Formula to look up the image

LookUp('Foto''s Manco App', Title= DataCardValue16.Text & " " & DataCardValue19.Text, ImageData)

So I guess we could change this formula around to take the last ID with that formula? @v-bofeng-msft  

How could I do this? @v-bofeng-msft 

Hi @TimoMigchielsen :

If you only need to modify the record with the highest ID, just replace the item attribute of the form with 


First(Sort('Foto''s Manco App',ID,Descending))


on the basis of the scheme I provided Off.

Best Regards,


I also need to check 2 textfields because that is the name of the image. These names will not be unique cause it is: projectname space ticket id 

example:  18037-31_3010 48

So whenever someone changes the picture, it will have the same but the ID of the row will be higher. I always want to take the latest picture. There must be a way to get the highest ID combined with the code to lookup the pictures, right? @v-bofeng-msft 

Community Support
Community Support

Hi @TimoMigchielsen :

Please try this code:

First(Sort(Filter('Foto''s Manco App',field1="XXX"&&Field2="XXXXX"),ID,Descending))

Best Regards,


I tried to put this code in my Image section:


First(Sort(Filter('Foto''s Manco App',DataCardValue16.Text & " " & DataCardValue19.Text),ID,Descending));
LookUp('Foto''s Manco App', Title= DataCardValue16.Text & " " & DataCardValue19.Text, ImageData)


This gives me an error, could you please explain where to put your code? @v-bofeng-msft  

I thought we could just use this code below and then get the highest ID of that lookup formula:

LookUp('Foto''s Manco App', Title= DataCardValue16.Text & " " & DataCardValue19.Text, ImageData)

So basically, this formula looks up: the title of datacardvalue16 with a space between and then datacardvalue19, and then takes the image. All we need to do is take the highest ID 

Hi @TimoMigchielsen 


Best Regards,


There is just one problem, you use a gallery and I use the UploadedImage with a LookUp formula, you are kind of confusing me now haha @v-bofeng-msft 

I tried to put it in the OnVisible of the screen, did not work

On the item attribude of the form I already have this:  SelectedItem

Hi @TimoMigchielsen :

Could you tell me if my description is correct:

  • The addpicture control is in the images_Card datacard.
  • the images_Card datacard is in a form.

In addition ,The gallery in my solution is only used to select records. Just change the item attribute of the form according to what I said, and this gallery can be deleted.

Best Regards,


Helpful resources

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users


We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (75,925)