cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Re: 2 dropdown lists to filter gallery

@v-siky-msft 

 

Sorry, forget to attach the screenshot. Here it is:

Highlighted
Resolver I
Resolver I

Re: 2 dropdown lists to filter gallery

I have found a workaround by controlling which fields are visible in the Detail screen. As each log is entered on a separate line (i.e. morning, afternoon, etc) by hiding the empty fields it will only show the fields with data in (i.e. for the morning, afternoon, etc.).

i.e. If(IsBlank(ThisItem.'Lunch Accepted'),false,true)

 

This means that I should achieve the end result by just filtering the Gallery by the DatePicker1.

 

I have got this to work: Filter('Daily Logs', DayMonthYear = Today()) but can't work out how to get it to recognise the DatePicker. Does anyone know what I need to replace Today() with to achieve this please.

Highlighted
Helper I
Helper I

Re: 2 dropdown lists to filter gallery

you can't filter by Date, you need to create a hidden column and convert the date to yyyymmdd format e.g. 20191115. Then filter based on this hidden column.

Highlighted
Resolver I
Resolver I

Re: 2 dropdown lists to filter gallery

Hi @IvanZ, thanks for the reply.

I've created a new single line text column called 'DateCol'. Can you help with the formula to make the DateCol data card equal Datepicker1 in the EditForm? I get that I'd have to convert the date value to text but I don't know how to do that in a formula.

Also what would the formula be for the Gallery items property for it to filter from a Drop-down list showing Distinct values from DateCol?

Highlighted
Helper I
Helper I

Re: 2 dropdown lists to filter gallery

My previous answer didnt get posted and I am posting using mobile so I will keep it short.

DateCol default property: Text(datepicker.selectedday,”yyyymmdd”)

Gallery item: filter(SPlist, datecol=varFilter)
In dropdown datecol, onchange property, UpdateContext({varFilter:dropdown.selected.value})
Highlighted
Resolver I
Resolver I

Re: 2 dropdown lists to filter gallery

Hi @IvanZ , thank you for your help with this. But I'm not there yet.

I've entered the formula's as described (hopefully) and, although there are no errors (no white crosses in red circles), it isn't working as hoped.

I've attached screen shots to show what I have put in.

The Dropdown_DateCol isn't showing varFilter but the DropDownSample (1,2,3). Should there be something in Items?

 

Kev

 

Helper I
Helper I

Re: 2 dropdown lists to filter gallery

I hate IE, gave me error and I have to retype it again. I reread your question, and there are few things you need to modify

 

1. In your "Daily log' sharepoint list (datebase), is there a column datecol which you convert the date to ddmmyyyy, or yyyymmdd format?( yyyymmdd is preferred)?If not, you need to do this first, or if your sp list will not going over 2000, then you can do addcolumn with collection to avoid physically create a column in SP datebase.

 

2. In powerapps, create a label, text=Text(datepicker1.selectedDates,"yyyymmdd"), now the text should be 20191116 when you play with datepicker1.

 

3. Create a height flexible gallery, in item=Filter('Daily logs',DateCol = text1.Text), it should now filter your gallery based on datepicker1 now.

 

4. Your shiftperiod dropdown is good, now in your gallery, selected all the parts (date, person, shift period, arrow, separator)  and choose "group", in the group's Visible property = If(Thisitem.shiftperiod = varFilter,true,false)

 

5. Now if you play it, it should filter based on datepicker1, and it will further hide the item based on shift dropdown.

View solution in original post

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,424)