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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,384)