cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
satya
Helper II
Helper II

Searching Yes/No type columns in Power apps

i have Created a Power App form and have the Search Text box, when i am search on text box as true/false . it is giving the result propertly. i am using the formula as below.

Filter('ListName',TextInputSearch.Text in Active)

here Active is the Yes/No type column in SharePoint list,but i need to searh as Yes/No in Search box. could you please suggest me

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @satya,

 

There are workarounds to deal with this situation. 

Depends on the requirement for the TestInputSearch Box,

If it is required, then we could build a local collection to hold the Yes/No to True/False mapping, then add a Label control to show the true or false.

Steps should be:

1. Under the OnVisible property of the first screen, enter the following to generate the local collection:

ClearCollect(YesMap,
Table({YesField:"Yes",TrueField:"true"},
{YesField:"No",TrueField:"False"})
)

2. Add a label control (Label1),  within the Text property of the Label control, enter the following:

LookUp(YesMap,YesField=TextInput1.Text,TrueField)

3. After testing with the TestInputSearch.Text, and confirms that the true or false works, then switch the Visible property of the Label control from true to false.

4. Under the Gallery items property, switch the formula to:

Filter('ListName',Label1.Text in Active)

If the Search Box is not required, then please replace it with a Dropdown control, with items set to:

Table({YesField:"Yes",TrueField:"true"},
{YesField:"No",TrueField:"False"})

Then under the Items property of the gallery control, switch the formula as below:

Filter('ListName', Dropdown1.Selected.TrueField in Active)

Let me know if you have any further concern on this issue.

Regards,

Michael

 

Community Support Team _ Michael Shao
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

1 REPLY 1
v-micsh-msft
Community Support
Community Support

Hi @satya,

 

There are workarounds to deal with this situation. 

Depends on the requirement for the TestInputSearch Box,

If it is required, then we could build a local collection to hold the Yes/No to True/False mapping, then add a Label control to show the true or false.

Steps should be:

1. Under the OnVisible property of the first screen, enter the following to generate the local collection:

ClearCollect(YesMap,
Table({YesField:"Yes",TrueField:"true"},
{YesField:"No",TrueField:"False"})
)

2. Add a label control (Label1),  within the Text property of the Label control, enter the following:

LookUp(YesMap,YesField=TextInput1.Text,TrueField)

3. After testing with the TestInputSearch.Text, and confirms that the true or false works, then switch the Visible property of the Label control from true to false.

4. Under the Gallery items property, switch the formula to:

Filter('ListName',Label1.Text in Active)

If the Search Box is not required, then please replace it with a Dropdown control, with items set to:

Table({YesField:"Yes",TrueField:"true"},
{YesField:"No",TrueField:"False"})

Then under the Items property of the gallery control, switch the formula as below:

Filter('ListName', Dropdown1.Selected.TrueField in Active)

Let me know if you have any further concern on this issue.

Regards,

Michael

 

Community Support Team _ Michael Shao
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

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

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,752)