title: How to get gallery item index in PowerApps?
body: <p>I created a simple news browsing application with <a href="https://powerapps.microsoft.com/en-us/" rel="nofollow">PowerApps</a>. To display articles list I use <a href="https://powerapps.microsoft.com/en-us/tutorials/control-gallery/" rel="nofollow">Gallery</a> control named <code>NewsGallery</code>. The <a href="https://powerapps.microsoft.com/en-us/tutorials/working-with-data-sources/" rel="nofollow">data source</a> for it is my <a href="https://powerapps.microsoft.com/en-us/tutorials/register-custom-api/" rel="nofollow">custom api</a> that returns the collection of <code>Articles</code>. My article entity contains of <code>Text</code>, <code>Title</code> and <code>TitleImage</code>. Let's say I want to display a number of an article in my <code>NewsGallery</code>. I can access the bound data through the <a href="https://powerapps.microsoft.com/en-us/tutorials/operators/#thisitem-operator" rel="nofollow">ThisItem</a> operator and can easily display my article's <code>Text</code>, <code>Title</code> or <code>TitleImage</code>. Also, as it is mentioned in <a href="https://powerapps.microsoft.com/en-us/tutorials/show-images-text-gallery-sort-filter/" rel="nofollow">this article</a>, I can determine either the item <code>IsSelected</code> in the gallery using <code>ThisItem</code> operator: <code>ThisItem!IsSelected</code>. <strong>So can I get the index of an item in my <code>NewsCollection</code> also using <code>ThisItem</code> operator? Or is there another way?</strong> As a workaround I can pass this value through my custom api but I wouldn't want to do that.</p>