Quick share a easy way I mostly used to index the gallery items, which may help while you’re create a editable gird funciton or something like that.
CountRows(Split(First(Split(Concat(<GalleryItems>,Text(<GUIDField>),"|"), ThisItem.<GUIDField>)).Value, "|"))
<GalleryItems> by the data source(Collection? or something) used in Gallery Items, and replace <
GUIDField> by the unique field in that data source.
Here is a example: