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 / Collect save value not ID
Power Apps
Answered

Collect save value not ID

(0) ShareShare
ReportReport
Posted on by 3

Hi,

 

I am fairly new to this so any help would be appreciated.

 

On opening my I create a collection use the following formula.

 

ClearCollect(OrganiserCollection, Organiser).

 

Organser is a database from sharepoint and has lookup columns.

 

I need to sort the data in a galery useing sortbycolumns.

 

The lookup columns cannot be sorted as the value is not saved in the collection.  Is the a way to save the value to the collection,

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Tea4d,

    Could you please share more details about the SortByColumns function within your app?

    Do you want to sort your Gallery items based on LookUp column?

    Further, do you mean that the LookUp column value is not saved into your OrganiserCollection?

    I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:

    3.JPG4.JPG5.JPG

    Note: The Outcome column is a LookUp type column in my SP list.

    Please take a try to set the OnVisible property or OnStart property of the firts screen of your app to following:

    ClearCollect(OrganiserCollection, Organiser)

    then check if the issue is solved.

    If the issue still exists, please consider re-create your app, then try above formula again, check if the issue still exists.

    In addition, if you want to sort your Gallery items based on LookUp column (rather than the value within the LookUp column), I afraid there is no way to achieve your needs. Sorting Gallery items using SortByColumns function based on LookUp column is not supported within PowerApps.

    As an alternative solution, you could consider take a try to save the value (not LookUp column itself) within the LookUp column into another new column, and then sort your Gallery items based on the new column.

    I have made a test on my side, please take a try with the following workaround:6.JPG

     

    7.JPG

    Set the OnVisible property or OnStart property of the first screen of my app to following:

    ClearCollect(
    RecordsCollection,
    AddColumns('20181019_case9_Courses',"LookUpValue",Outcome.Value)
    )

    On your side, you should type:

    ClearCollect(
    OrganiserCollection,
    AddColumns(Organiser,"LookUpValue",YourLookUpColumn.Value) /* <-- YourLookUpColumn represents the LookUp column in your SP list */
    )

    Set the Items property of the Gallery control to following:

    SortByColumns(RecordsCollection,"LookUpValue",Descending)

    On your side, you should type:

    SortByColumns(OrganiserCollection,"LookUpValue",Descending)

    More details about the AddColumns function, please check the following article:

    AddColumns

     

    Best regards,

    Kris

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 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard