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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Alphabetize new...
Power Apps
Unanswered

How to Alphabetize new Form Records in Gallery View and SP List

(1) ShareShare
ReportReport
Posted on by 6
Hi.  I'm working with a Gallery and Form that uses an SP List as Data Source.  When the user uses the form's "save" button with OnSelect = fx SubmitForm(FormName) to upload the new info, the new record in the Gallery and the SP List is added to the bottom of the list.  I'd like it to be alphabetized using the firs column "name" field as and example please.  Thanks!
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,351 Super User 2025 Season 2 on at
    Hi
     
    You would wrap your stuff in
     
    SortByColumns(InsertYourCurrentItemsValueHere, "NameOfColumnInQuotes", SortOrder.Ascending)
     
    Or use SortOrder.Descending
     
    And done.
     
    Please Mark as Answer if this helps and maybe a like.
  • nevik1 Profile Picture
    6 on at
    Tnx for the response.  So as a newbie "wrap your stuff in..." sadly isn't specific enough.
     
    I have  SubmitForm(frmNew_2) w/o the Sort control.  How does one wrap SortByColumns('IDTC Survey', FirstName) control?
     
    Don't understand the logic.  I think I'd need to SubmitForm first to add new fields\a record, and then sort all in the same code statement.
     
    Thanks!
  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at
    Hi CU17091535-0
     
    You would apply the formula to the Items property of your gallery control. The formula in the OnSelect of your button would stay exactly as it is. 
     
    The formula you would use to set the Items property of the gallery looks like this:
    SortByColumns(YourSharePointList, "NameColumn",SortOrder.Ascending)
     
    To sort the data that you see directly in SharePoint, you would need to modify the view. Here's a link to how to do this.
     
     
  • nevik1 Profile Picture
    6 on at
    Ok.  My Gallery Items = fx already includes Filtering so the App users only see the records where their email is listed, so i'd need to use it with SortByColumn together.  Not sure of the syntax b/c what I tried below does not work.
     
    e.g., 
    SortByColumns(
        Filter('My Survey',email1 = User().Email || email2= User().Email || email3 = User().Email
        ),"FirstName",SortOrder.Ascending)
     
    Thanks!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard