cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter gallery using textbox

Hi Guys,

 

I am trying to figure out how can I filter a gallery using a textbox. 

 

Scenario:

 

I have textbox that cointains different ticket status. When user select a status, the gallery should be filtered by the selected status.

 

Example:

 

User selects status "Pending", Gallery should show all tickets with "Pending" status.

 

Thank in advance 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous,

 

 

Do you want to filter the Ticket records (Right Gallery) when you click the Status icon (a Group, consists of Label controls)?

 

I have made a test on my side, please take a try with the following workaround:15.JPG

 

16.JPG

 

 

Set the OnSelect property of the "All tickets" group to following formula:

UpdateContext({StatusValue:"All"})

Set the OnSelect property of the "New ticket" group to following formula:

UpdateContext({StatusValue:"New"})

Set the OnSelect property of the "In progress" group to following formula:

UpdateContext({StatusValue:"In progress"})

Set the OnSelect property of the "Closed" group to following formula:

UpdateContext({StatusValue:"Closed"})

Set the OnSelect property of the "On hold" group to following formula:

UpdateContext({StatusValue:"On hold"})

Set the Items property of the Gallery control to following formula:

If(StatusValue="All",Tickets,Filter(Tickets,Status=StatusValue))

The GIF image as below:Test1.gif

 

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
TomasZubov
Resolver I
Resolver I

Hello,

 

 I'm using following in such case 

In gallery items:

For drop down:
Filter(<SourceOfGaleryItems>;<TicketStatusField>=Dropdown1.Selected.Value))

For text:

Filter(<SourceOfGaleryItems>;<TicketStatusField>=TextField_1.Text))
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you please share a bit more about the Textbox that you mentioned? Is it a Dropdown control?

 

I agree with @TomasZubov's thought almost.

 

If the Textbox that you mentioned is a Dropdown control populated with multiple ticket status, please set the Items property of the Gallery control to following formula:

 

Filter(YourDataSource,StatusColumn=Dropdown1.Selected.Value)

Note: The StatusColumn is a column in your data source, which is used to store the status value. But if your data source is a SP list and the StatusColumn is a Choice type column, please take a try with the following formula:

 

Filter(YourDataSource,StatusColumn.Value=Dropdown1.Selected.Value)

 

If the Textbox that you mentioned is a TextInput box , please take a try to set the Items property of the Gallery control to following formula:

 

Filter(YourDataSource,StatusColumn=TextInput1.Text)

Note: If your data source is a SP list and the StatusColumn is a Choice type column, please take a try with the following formula:

Filter(YourDataSource,StatusColumn.Value=TextInput1.Text)

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-xida-msft,

 

I am currently using the service desk template. What I am trying to figure out is how to filter a gallery based on the selected status.

 

Thanks 🙂

 

Capture.PNG

Hi @Anonymous,

 

 

Do you want to filter the Ticket records (Right Gallery) when you click the Status icon (a Group, consists of Label controls)?

 

I have made a test on my side, please take a try with the following workaround:15.JPG

 

16.JPG

 

 

Set the OnSelect property of the "All tickets" group to following formula:

UpdateContext({StatusValue:"All"})

Set the OnSelect property of the "New ticket" group to following formula:

UpdateContext({StatusValue:"New"})

Set the OnSelect property of the "In progress" group to following formula:

UpdateContext({StatusValue:"In progress"})

Set the OnSelect property of the "Closed" group to following formula:

UpdateContext({StatusValue:"Closed"})

Set the OnSelect property of the "On hold" group to following formula:

UpdateContext({StatusValue:"On hold"})

Set the Items property of the Gallery control to following formula:

If(StatusValue="All",Tickets,Filter(Tickets,Status=StatusValue))

The GIF image as below:Test1.gif

 

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

It's working now @v-xida-msft. Thank you so much 🙂

 

By the way, I just have another question. Currently I am now able to filter it by "Status", Can I also filter it by the creator of the ticket?

alikhan_31
Frequent Visitor

I have another problem.

how we can select multiple records in the same text box with semi-colon separate as we are sending emails to them on the next screen.

powerapp.jpg

@v-xida-msft what if I don't have statusvalue as All how can I just show all values when I click on All ? also by default how can I show all values ? 

 

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (7,179)