Hi all,
I've seen the powerapp platform behave so inconsistently when using the Gallery that it makes me wonder what is a safer alternative. My latest and simplest to explain issue is as follows:
Place a gallery based on a datasource (cached view of SQL DB)
Place an Image within the gallery, with the Image property having the value:
LookUp(dimResidentPhoto, PhotoFileID = ThisItem.PhotoFileID).Photo
And voila, it doesn't look up correctly. On very first load it will actually load fine, but as soon as you refresh/filter the lookups are off. I have confirmed and write out the PhotoFileID alongside the image and they are definitely unique, and there is definitely a different photo for each ID. The filters/data is definitely working fine, only the lookup/image is causing problems.
So even though the ID is different, it always grabs/shows the first photo for ALL gallery elements. Obviously this is a bug, but what are my alternatives?
Solved! Go to Solution.
@Anonymous
An alternative is to do this in the Items property of the gallery.
Ex:
AddColumns(
yourDataSource As _source,
"_photo", LookUp(dimResidentPhoto, PhotoFileID = _source.PhotoFileID).Photo
)
Then set the Image property to ThisItem._photo
This will perform the lookup as part of the table for the Gallery rather than having each line in the gallery then do its lookup - as this occurs after the rendering of the gallery.
I hope this is helpful for you.
@Anonymous
An alternative is to do this in the Items property of the gallery.
Ex:
AddColumns(
yourDataSource As _source,
"_photo", LookUp(dimResidentPhoto, PhotoFileID = _source.PhotoFileID).Photo
)
Then set the Image property to ThisItem._photo
This will perform the lookup as part of the table for the Gallery rather than having each line in the gallery then do its lookup - as this occurs after the rendering of the gallery.
I hope this is helpful for you.
Thanks Randy, I have noticed that using a cached view (rather than a DB lookup) also solves the problem.
User | Count |
---|---|
252 | |
126 | |
105 | |
50 | |
50 |