I have a powerapp screen where i have implemented a slideshow using below code.
OnVisible of Screen
Collect(
imgList,
{
img: globvar.Image1,
order: 1
},
{
img: globvar.Image2,
order: 2
},
{
img: globvar.Image3,
order: 3
},
{
img: globvar.Image4,
order: 4
}
);
UpdateContext({currentImg: 1});
Image field
LookUp(imgList,order=currentImg).img
Back Icon in slideshow
UpdateContext({currentImg:If(currentImg=1,Max(imgList,order),currentImg-1)})
Next Icon in slideshow
UpdateContext({currentImg:If(currentImg=1,Max(imgList,order),currentImg+1)})
I have 2 images only in above collection and 2 images are empty, then clicking on next icon should not show blank images. However currently it shows blank images as well.
May i know how to avoid this?