Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Re: Gallery Overlay Question

You won't always have a row number in your dataset (for example, I use this method a lot to put overlays on images using data returned as JSON from Cognitive Services Vision API) so here is a trick to generate a RowNum column for any collection. Given your data shown below:

    {region: "System Wide-1", x: 140, y: 180},
    {region: "System Wide-2", x: 140, y: 310},
    {region: "West-1", x: 317, y: 145}, 
    {region: "West-2", x: 527, y: 139}, 
    {region: "West-3", x: 460, y: 399},
    {region: "West-4", x: 280, y: 335},
    {region: "East-1", x: 620, y: 240},
    {region: "East-2", x: 775, y: 115}, 
    {region: "East-3", x: 923, y: 300},
    {region: "East-4", x: 636, y: 455}

You can do the following (needs be triggered by an action such as OnVisible or OnSelect):

ForAll(colMapPins,Collect(colMapPinsWithRow, {region: region, x: x, y: y, RowNum:CountRows(colMapPinsWithRow)})

This will give you a new collection adding the column RowNum which will start at 0 and increment 1 for each row.

Use the collection with RowNum for your Gallery's items property. When positioning your icons you can set the Y value (assuming a vertical gallery) to 

ThisItem.y - ThisItem.RowNum

Would be great to really be able to set the templatesize to 0 (if you try it actually reverts back to 1) or have a built-in ability to determine the row number of an item in a gallery, but this trick seems to work.

Level 10

Re: Gallery Overlay Question

Awesome contribution Paul!
Thank you!

Helpful resources


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 102 members 5,116 guests
Please welcome our newest community members: