cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MH3
Post Prodigy
Post Prodigy

Sorting Gallery Items

Hello Everyone,

I have a Gallery with a Filter of Logged in User and Date, and I am using SQL as my DataSource.

but I have to sort the Gallery, when the date is selected, it should sort by TimeSlot.

Right Now, Current Gallery:
TimeSheet_Filter Gallery.jpg

I want to sort the Gallery the Text Highlighted, its the TimeSlot Description,

TimeSlot_Gallery.jpg
TimeSlot Text: 

LookUp('[dbo].[TsTimeSlot]', Id= ThisItem.TimeSlot).Descr

I tried to sort the gallery by calling the Table Name: 'TimeSlot', but it's not working, as the Time Text is the Description field in 
this Table.

Any Help, Please

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User III
Super User III

Try

Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser && Text( Date, "[$-en-US]dd/mm/yyyy" )=Text(DatePicker1.SelectedDate,"[$-en-US]dd/mm/yyyy")),TimeSlot)

 

Does your formula work before the sort?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

4 REPLIES 4
eka24
Super User III
Super User III

You may have to display the formula for ITEMS of the Gallery.

 

Meanwhile try;

Sort('[dbo].[TsTimeSlot]', TimeSlot)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

MH3
Post Prodigy
Post Prodigy

Hi @eka24 ,

 

I have tried your formula, but it's not working it shows an error.
TimeSlot_Gallery.jpg
I want to sort the gallery with my filter function together:

Filter Code:

Filter('[dbo].[TimeSheet]',UserId= MyUser && Text( Date, "[$-en-US]dd/mm/yyyy" )=Text(DatePicker1.SelectedDate,"[$-en-US]dd/mm/yyyy"))


I want to combine Sort and Filter together
Any help

 

eka24
Super User III
Super User III

Try

Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser && Text( Date, "[$-en-US]dd/mm/yyyy" )=Text(DatePicker1.SelectedDate,"[$-en-US]dd/mm/yyyy")),TimeSlot)

 

Does your formula work before the sort?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

MH3
Post Prodigy
Post Prodigy

Thanks @eka24 ,

 

it Worked!!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (109,466)