cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mihamocnik
Helper II
Helper II

Is it possible to sort items on Map component?

Hello!

 

Is there any way to sort items on Map component? I tried with Sort by columns but without any effect. Just want to see items by created on ascending. Please advise

mihamocnik_0-1658411639827.png

 

BR,

Miha

 

7 REPLIES 7
v-bofeng-msft
Community Support
Community Support

Hi @mihamocnik ,

 

Please set the Map's Items property to:

With({SortTheTable:Sort(CheckIn,createdon)},
  ForAll(Sequence(CountRows(SortTheTable)),Patch(Last(FirstN(SortTheTable,Value)),{Rank:Value}))
)

and then set it's ItemsLabels property to:

"Rank"

vbofengmsft_0-1658469684241.png

 

Best Regards,

Bof

Hi Bof,

 

I tried & also added ascending but without any success:/ current location (Frodx) should be 1 since it was created as first record. I have also list on the other screen which is okay to be as descending.

 

Map:

mihamocnik_0-1658474797720.png

 

List:

mihamocnik_1-1658474886469.png

 

Is there any bug in the system?


BR,

Miha

 

 

Hi @mihamocnik ,

 

Did you set the Map's ItemsLabels property to:

"Rank"

?

 

Please try:

With({SortTheTable:Sort(Filter(CheckIn,'Created On'=Today()),createdon,Descending)},
  ForAll(Sequence(CountRows(SortTheTable)),Patch(Last(FirstN(SortTheTable,Value)),{Rank:Value}))
)

 or

With({SortTheTable:Sort(Filter(CheckIn,'Created On'=Today()),createdon,Ascending)},
  ForAll(Sequence(CountRows(SortTheTable)),Patch(Last(FirstN(SortTheTable,Value)),{Rank:Value}))
)

 

Best Regards,

Bof

Hi Bof,

 

Tried all but it is still the same:/

 

 

Descending

mihamocnik_0-1658475704467.png

 

Ascending

mihamocnik_1-1658475756182.png

 

Items label

mihamocnik_2-1658475781764.png

 

Hi @mihamocnik ,

 

Could you please show me the data table?(Save the data into a collection named test collection and show me the value please)

 

 

ClearCollect(
  TestCollection,
  ShowColumns(
     With({SortTheTable:Sort(Filter(CheckIn,'Created On'=Today()),createdon,Ascending)},
         ForAll(Sequence(CountRows(SortTheTable)),Patch(Last(FirstN(SortTheTable,Value)),{Rank:Value}))
     ),
     "createdon",
     "Rank"
)

 

 

Best Regards,

Bof

 

Hi Bof,

 

it shows ascending 

mihamocnik_0-1658483775620.png

 

BR,

Miha

Hi @mihamocnik ,

 

Did you find the "Rank" column?

vbofengmsft_0-1658712790847.png

 

Best Regards,

Bof

 

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 (4,052)