web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding items to a gall...
Power Apps
Answered

Adding items to a gallery alphabetically consecutive

(0) ShareShare
ReportReport
Posted on by 3,295

Hi there,

Is this possible?

I would like to add items to my order in my gallery but I want each item have a letter

a) Product A, 700 mg, Case x 60

b) Product D, 1500 mg, pail

c) Product G, 1 Kilo, case x 1 EA

 

What is the best option for this?

Is a Share Point List, the products A,B,C....etc the unit 700mg, etc and the product specification comes from drop down list. I want to present all the product concatenate in a label "I can do that" but I need help on how to ADD the a), b), c)..... etc to each product added to my collection

 

Any idea?

 

thanks in advance

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Patching-an-item-index-number-into-a-collection/td-p/339716

     

    You can use this link. This is for numbering instead of alphabets but you can change it a bit to get what you want. 

  • Sajarac Profile Picture
    3,295 on at

    Thank you very much for your prompt response.

     

    I have downloaded the file. Is not easy for a new guy. I think in fact that is a little bit complicated. Do you really think that this solution will fit when I add a new item to my gallery?

     

    Sorry I am confused now.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This solution is slightly modified from @RezaDorrani answer on this post. It should work but this is numerically sorted. 

    ForAll(
     <YourCollection>,
     Collect(
     colIndexed,
     {
     Product: <YourCollection>[@Product],
     Amount: <YourCollection>[@Amount], 
     Specification: <YourCollection>[@Specification],
     Index: CountRows(colIndexed)+1
     }
     )
    );

     

    This solution should work even if you add more items to your gallery. Set items property to colIndexed. However, when you add/delete, you have to clear colIndexded and run this again.

     

    And then you can create a mapping between numbers and alphabets. You would have to decide what happens after you run out alphabets.

    ClearCollect(NumberToLetterMap,{1:"a)",],{2:"b)"],{3:"c)"} .....);

      

    And finally you can do this to get the letter

    NumberToLetterMap.(ThisItem.Index)
  • Sajarac Profile Picture
    3,295 on at

    Hi @Anonymous,

     

    Sorry to bother you. Is there any easy way to add a letter when I "ADD" a new item to my form or when I save a new item to my share point list?

     

    Thanks in advance

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Use the patch function to add a new item to your SPO list I called it <YourCollection>

    Patch( 
     <YourCollection>, 
     Defaults( <YourCollection> ),
     {
     Product: <ProductName>,
     Amount: <Amount>, 
     Specification: <Specification>,
     Index: NumberToLetterMap.(CountRows(<YourCollection>)+1)
     }
     )

     

    Best,

    Zabi

    _______________________________________________________________________________________________________________________________________

    Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than one answers as solutions, including your own answer. 🙂

  • KrishnaV Profile Picture
    5,023 on at

    Hi @sajarac ,

     

    I just want to follow up with you on this issue to see is it resolved or still you see any challenges.

    If you see any challenge/need further help let me know I am always happy to help.

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @sajarac ,

     

    Try this:

    Sort(datsource,columnsname,Asscending)

     
    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard