cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShriniA
Helper I
Helper I

SharePoint List Form : Sort order of Lookup column

Hi,

 

I create SharePoint list and its Newform is customized by using PowerApps. There is a lookup field and I want to sort order.

ShriniA_0-1643592342696.png

@HCP旅行手配依頼書 is column name and 企画イベント名 is lookup column.

 

Ex: My Lookup data dropdown list will appear like this.

20211023_XXX

20211110_XXX

20211127_XXX

20211205_XXX

20220115_XXX

But I want to sort it like this.

20220115_XXX

20211205_XXX

20211127_XXX

20211110_XXX

20211023_XXX

 

Any help or guidance would be greatly appreciated.

Thank you.

14 REPLIES 14

@WarrenBelz 

 

New Events are added frequently, so there is no limit. Currently, we have 50+ items(events).
When we have a new event, then the original event list will be updated day by day.

 

@ShriniA ,

OK - was trying to find out whether you had a Delegation issue here (and you will once you get beyond 2,000 items), however 50 items will not affect this presently. So to summarise

  • You have a Single Line of Text (not calculated) field called 'Event Name' (you need to be very clear about this)
  • You have a Lookup field  企画イベント名 you want to sort on

and the code below (modified slightly here)

Sort(
   Filter(
      AddColumns(
         SPListName,
         "SortField",
          企画イベント名 .Value
      ),
      Len(SortField) > 0
   ),
   SortField
).'Event Name'

does not show you this field ?

 

@WarrenBelz 

I am afraid that the 'Event Name' field that you mentioned  Single Line of Text (not calculated) is not clear for me.

I know this is a very complicated situation I asked.

 

But anyhow I will explain why I used calculated filed for events. Because that event name will be long we combined 3 fields to Calculated text field as the event name. 

Calculated filed = Date+Event+Person Name and this field is used for a lookup field.

Hi @ShriniA ,

My reason for clarifying this goes back a couple of posts - SharePoint calculated fields rarely work properly in Power Apps and you really should not use them. You need to store that information in a Single Line of Text and then it all should work as you expect. Also as I mentioned Lookup columns will frequently cause you unwanted and unnecessary problems - I have a blog on data structure that may be useful to you.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

Hi @ShriniA ,

 

You may consider use the 企画イベント list (Events list) directly as the Items of the Combo box, and sort the list by ID in descending at the same time.

Sort('企画イベント',ID, Descending)

 

The only effort you need to make is to modify the Update property of the 企画イベント DataCard so as the app can update the selected item to the LookUp column correctly:

LookUp(Choices([@HCP旅行手配依頼書].企画イベント名), Id = 企画イベント名DataCardValue.Selected.ID)
//企画イベント名DataCardValue is the Combobox for selecting events.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,571)