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 🙂
Solved! Go to Solution.
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:
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:
Best regards,
Kris
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))
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
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 🙂
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:
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:
Best regards,
Kris
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?
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.
@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 ?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
189 | |
69 | |
49 | |
46 | |
18 |
User | Count |
---|---|
252 | |
127 | |
84 | |
76 | |
74 |