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.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,295)