Skip to main content
Community site session details

Community site session details

Session Id : Ed4O0neNDPxQlchimFTg2S
Power Apps - Microsoft Dataverse
Unanswered

Numbering items to display in a gallery

Like (0) ShareShare
ReportReport
Posted on 7 Mar 2024 14:31:03 by 79

Hi,

 

I need some assistance with numbering items in a gallery. 

I have 2 tables in Dataverse:


Table 1: Application Table - Unique Identifier is Ticket Number 
Table 2: Comments Table - Unique Identifier is Comment Number

Whenever a comment is captured, its updated with its corresponding Ticket number in the comments table.

I have a gallery in the comments page that displays all the comments posted for a specific ticket however, the reference numbers are non-sequential as the comments are posted on different dates and times for different tickets.

Please see below image:

RG1601_0-1709820509663.png

 

The goals is to display the comment number in a sequential order within the gallery. I have used the approach in the article here however it's not as responsive as I would like it be when posting a new comment. Further to the above, it poses a different problem as the users can download the file in excel and then the sequence will be off again. 

Is it possible to create a column within the comments table that will automatically assign a sequential comment number for display within the gallery?

Example (Sequence Number):

Comment IdDate PostedTime PostedCorresponding TicketSequence Number
Comment - 12024/03/0111:57amTicket-11
Comment - 22024/03/0212:00pmTicket-71
Comment - 32024/03/0312:04pmTicket-12
Comment - 42024/03/0401:00pmTicket-51
Comment - 52024/03/0503:00pmTicket-72
Comment - 62024/03/0609:00amTicket-52
Comment - 72024/03/0705:00pmTicket-13
Comment - 82024/03/0806:15amTicket-73

 

Any help will be appreciated

Regards,

Categories:
  • citdevpros Profile Picture
    61 on 08 Mar 2024 at 03:10:07
    Re: Numbering items to display in a gallery

    Hi @RG1601 ,

    My understanding of DataVerse autonumbers is that you can't partition them by another column, they just don't allow that level of complexity.

     

    The simplest way to do this is to patch the Sequence Number value at the time the comment is submitted.

    1. Filter your Comment table for records that relate to the "Corresponding Ticket" value
    2. group and get max(Sequence Number) + 1, and
    3. write that as the sequence number of the newly created comment

    Better than doing a row-by-row evaluation every time you retrieve the comments for a ticket, and the correct sequence is available in a download of the data. The only thing this doesn't account for is renumbering if comments are deleted, if that is even a function you are implementing.

  • RG1601 Profile Picture
    79 on 07 Mar 2024 at 20:57:23
    Re: Numbering items to display in a gallery

    Hi @Jmanriquerios ,

    Thanks for the feedback, could you elaborate a bit more on how this could be achieved?

    Regards,

  • Jonathan Manrique Profile Picture
    2,682 on 07 Mar 2024 at 14:44:20
    Re: Numbering items to display in a gallery

    Hi @RG1601 

     

    You can use the autonumeric column in the dataverse, which is sequential and forms the number where the dataverse is not processed.

     

    Autonumber columns in Microsoft Dataverse - Power Apps | Microsoft Learn

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Featured topics

Loading complete