cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
osaunier
New Member

Display a dropdown containing short dates and filter gallery on it

Hi,

 

I've read a lot of things about dates and dropdown but I can't figure out how to achieve this.

 

I want to use the CreationDate to filter a Gallery. Easy. But I want in my dropdown a distinct and only the dates so it becomes :

From

01/12/2020 16:52:00

01/12/2020 17:20:00

13/12/2020 09:22:00

14/12/2020 13:12:00

14/12/2020 14:15:00

18/12/2020 10:10:00

To

01/12/2020

13/12/2020

14/12/2020

18/12/2020

 

And when I select in the dropdown 14/12/2020 it display in my gallery the Two corresponding records.

 

I've tried to build a collection, I've tried to add a column,... I'm stuck.

 

Thanks for your help,

 

Olivier

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @osaunier ,

 

@Drrickryp 's solution is great, but with a minor hitch on Filter formula.

 

The Dropdown1.Selected.Result return the Short Date Text, so an incompatible type error occurs in the filter formula. Please modify the formula as follows.

Filter(AddColumns('Table',"shortdate",Text('CreationDate',ShortDate)),'shortdate'=Dropdown1.Selected.Result)

Hope this helps.

Sik

 

View solution in original post

3 REPLIES 3
Drrickryp
Super User II
Super User II

Hi @osaunier 

 

Distinct(
    AddColumns(
        ds,
        "shrtdate",
        Text(
            'CreationDate',
            ShortDate
        )
    ),
    shrtdate
)

 

and in the Value dropdown on the right column, select Result to show in the window.  Filter your gallery with 

 

Filter(ds,'CreationDate'=Dropdown1.Selected.Result

 

Replace ds with the name of your data source.dropdown.png

v-siky-msft
Community Support
Community Support

Hi @osaunier ,

 

@Drrickryp 's solution is great, but with a minor hitch on Filter formula.

 

The Dropdown1.Selected.Result return the Short Date Text, so an incompatible type error occurs in the filter formula. Please modify the formula as follows.

Filter(AddColumns('Table',"shortdate",Text('CreationDate',ShortDate)),'shortdate'=Dropdown1.Selected.Result)

Hope this helps.

Sik

 

View solution in original post

Thanks to the both of you @v-siky-msft & @Drrickryp , it's working!! I understand my mistake with the AddColumn into the Filter that I wasn't using.

 

Thanks again, I can move forward 🙂

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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (57,784)