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.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,308)