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 / How to Alphabetize new...
Power Apps
Suggested Answer

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,963 Moderator 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
    37,212 Super User 2026 Season 1 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 490

#2
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

#3
11manish Profile Picture

11manish 302

Last 30 days Overall leaderboard