cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jagadeeshk
Responsive Resident
Responsive Resident

Serial number for gallery

Hi,

How to add serial number for gallery items?

I cannot use local collection as my source is going beyond 2000.

1 ACCEPTED SOLUTION

Accepted Solutions

@Jagadeeshk ,

Did you read the blog? I also have some guidance using the With() statement.

The problem you have you have already identified, however it is still possible to use a local collection.

How many records are in your list? I referred you to the "up to 4,000" and "bigger than 4,000" items to see which one applied to you.

After that adding a number is not difficult. If for example you had under 4,000 rows this could be used in your gallery

With(
   {
      wAsc,
      Sort(
         YourListName,
         ID
      ),
      wDesc,
      Sort(
         YourListName,
         ID,
         Descending
      )
   },
   ClearCollect(
      colTemp,
      wAsc,
      Filter(
         wDesc,
         !(ID in wAsc.ID)
      )
   )
);
Clear(colMyCollection);
ForAll(
   colTemp,
   Collect(
      colMyCollection,
      Last(
         FirstN(
            AddColumns(
               colTemp,
               "SerialNo",
               CountRows(colMyCollection) + 1
            ),
            CountRows(colMyCollection) + 1
         )
      )
   )
);
Clear(colTemp)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @Jagadeeshk ,

Have a read of the "bigger then 4,000" comments on this Delegation blog of mine. There may also be some other useful information for you on it.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @Jagadeeshk ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Still I'm waiting for help

 

 

@Jagadeeshk ,

Did you read the blog? I also have some guidance using the With() statement.

The problem you have you have already identified, however it is still possible to use a local collection.

How many records are in your list? I referred you to the "up to 4,000" and "bigger than 4,000" items to see which one applied to you.

After that adding a number is not difficult. If for example you had under 4,000 rows this could be used in your gallery

With(
   {
      wAsc,
      Sort(
         YourListName,
         ID
      ),
      wDesc,
      Sort(
         YourListName,
         ID,
         Descending
      )
   },
   ClearCollect(
      colTemp,
      wAsc,
      Filter(
         wDesc,
         !(ID in wAsc.ID)
      )
   )
);
Clear(colMyCollection);
ForAll(
   colTemp,
   Collect(
      colMyCollection,
      Last(
         FirstN(
            AddColumns(
               colTemp,
               "SerialNo",
               CountRows(colMyCollection) + 1
            ),
            CountRows(colMyCollection) + 1
         )
      )
   )
);
Clear(colTemp)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @Jagadeeshk ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,188)