cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tea4d
Frequent Visitor

Collect save value not ID

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,

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,423)