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
Highlighted
Community Support
Community Support

Re: Collect save value not ID

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
Highlighted
Community Support
Community Support

Re: Collect save value not ID

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,495)