cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
heydamianards
Frequent Visitor

Filter Browse Gallery using Date Picker & Filter Gallery

Hi All,

 

I would like to know if its possible to combine 2 formulas for the browse gallery.

1. Filter Gallery act as a filter for status.

2. Date Picker act as a date filter.

 

My formula for the Filter Gallery:

If(ThisItem.Title="Active",UpdateContext({type:"Active"}),If(ThisItem.Title="Pending",UpdateContext({type:"Pending"}),If(ThisItem.Title="Acknowledged",UpdateContext({type:"Acknowledged"}),If(ThisItem.Title="Resolved",UpdateContext({type:"Resolved"}),If(ThisItem.Title="Overall Alerts",UpdateContext({type:"Overall Alerts"}))))))

 

My formula for the Browse Gallery:

If(type="Overall Alerts", 'MS Teams Alerts', If(FilterGallery.Selected.TextBox1.Text="Active",Filter('MS Teams Alerts',type in Status),If(FilterGallery.Selected.TextBox1.Text="Pending",Filter('MS Teams Alerts',type in 'Admin Status'),If(FilterGallery.Selected.TextBox1.Text="Acknowledged",Filter('MS Teams Alerts',type in 'Admin Status'),If(FilterGallery.Selected.TextBox1.Text="Resolved",Filter('MS Teams Alerts',type in Status))))))

 

I would like to include this formula:

Filter('MS Teams Alerts',Text('Date Received', "[$-en-US]mm-dd-yyyy")=Text(DatePicker1.SelectedDate, "[$-en-US]mm-dd-yyyy"))

 

For me to see my data per date and per status. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @heydamianards ,

Firstly, your first bit of code can be replaced by this

UpdateContext({type:ThisItem.Title})

If you add this somewhere when (Screen OnVisible should work)

UpdateContext({vChoose:FilterGallery.Selected.TextBox1.Text})

Then this on the Filter you are after - you may have to clean up brackets, commas etc as I cannot test it.

Filter(
   If(
      type="Overall Alerts", 
      'MS Teams Alerts', 
      Filter(
         'MS Teams Alerts',
         Switch(
            vChoose,
            "Active" || "Resolved",
	        'MS Teams Alerts',
            type in Status,
            "Pending" || "Acknowledged"
            type in 'Admin Status'
         )
      )
   ),
   DateDiff(
      'Date Received', 
      DatePicker1.SelectedDate,
      Days
   ) = 0
)

 

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.

View solution in original post

1 REPLY 1
WarrenBelz
Super User
Super User

Hi @heydamianards ,

Firstly, your first bit of code can be replaced by this

UpdateContext({type:ThisItem.Title})

If you add this somewhere when (Screen OnVisible should work)

UpdateContext({vChoose:FilterGallery.Selected.TextBox1.Text})

Then this on the Filter you are after - you may have to clean up brackets, commas etc as I cannot test it.

Filter(
   If(
      type="Overall Alerts", 
      'MS Teams Alerts', 
      Filter(
         'MS Teams Alerts',
         Switch(
            vChoose,
            "Active" || "Resolved",
	        'MS Teams Alerts',
            type in Status,
            "Pending" || "Acknowledged"
            type in 'Admin Status'
         )
      )
   ),
   DateDiff(
      'Date Received', 
      DatePicker1.SelectedDate,
      Days
   ) = 0
)

 

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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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