cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Tea4d
Level: Powered On

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

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

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,140)