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

Gallery filter formula comboboxes or text input

I have the below formula on my gallery which mostly works.  I have 2 comboboxes and 1 text input box.  

 

Goal: filter the gallery based on selections in either of the comboboxes or text input box.  The formula works when the comboboxes and text input box are empty (it returns the list in its entirely).  Additionally, the gallery will filter when text is in the text input box.  However, my issue comes when making a selection in a combo box - the gallery will not filter. 

 

Additional Info: I have a clear selections button that OnSelect resets all the comboboxes and text box.  Upon clicking it successfully removes the selection.  Not sure if this is causing an issue as it resets.   

 

If(IsBlank((TextInput1) && IsEmpty(ComboBox1.SelectedItems) && IsEmpty(ComboBox2.SelectedItems)),'Standards, Disclaimers & Disclosures', Filter('Standards, Disclaimers & Disclosures', 'Review Element(s)' in ComboBox1.SelectedItems.Result || 'Subject Matter or Content Topic(s)' in ComboBox2.SelectedItems.Result || TextInput1.Text in 'Required Language'))

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @enlitzinger ,

 

Sorry for my bad, I miss a ')' in the code, please try this:

Filter(
'Standards, Disclaimers & Disclosures',
If(IsEmpty(ComboBox1.SelectedItems),true, 'Review Element(s)' in Concat(ComboBox1.SelectedItems,Result&",")) ||
If(IsEmpty(ComboBox2.SelectedItems),true, 'Subject Matter or Content Topic(s)' in Concat(ComboBox2.SelectedItems,Result&",")) ||
If(IsBlank((TextInput1),true, TextInput1.Text in 'Required Language')
)

Hope this helps,

Sik

View solution in original post

9 REPLIES 9
Super User III
Super User III

Hi @enlitzinger ,

 

try this:

If(IsBlank((TextInput1) && IsEmpty(ComboBox1.SelectedItems) && IsEmpty(ComboBox2.SelectedItems)),'Standards, Disclaimers & Disclosures', Filter('Standards, Disclaimers & Disclosures', 'Review Element(s)' in Concat(ComboBox1.SelectedItems,Result&",") || 'Subject Matter or Content Topic(s)' in Concat(ComboBox2.SelectedItems,Result&",") || TextInput1.Text in 'Required Language'))


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more. 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Thanks @KrishnaV for the help but that formula is only working when all 3 (2 comboboxes and text input) have values in them.  It would be ideal to have them work when only 1 has values and the other 2 are blank.  Any advice?

Hi @enlitzinger ,

Try this:

If(IsBlank((TextInput1) && IsEmpty(ComboBox1.SelectedItems) && IsEmpty(ComboBox2.SelectedItems)),'Standards, Disclaimers & Disclosures',
If((!IsBlank((TextInput1) && IsEmpty(ComboBox1.SelectedItems) && IsEmpty(ComboBox2.SelectedItems))) || (!IsBlank((TextInput1) && !IsEmpty(ComboBox1.SelectedItems) && !IsEmpty(ComboBox2.SelectedItems))),
 Filter('Standards, Disclaimers & Disclosures', 'Review Element(s)' in Concat(ComboBox1.SelectedItems,Result&",") || 'Subject Matter or Content Topic(s)' in Concat(ComboBox2.SelectedItems,Result&",") || TextInput1.Text in 'Required Language'))
)

Regards,

Krishna 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Hi @enlitzinger ,

 

The above formula works, if all are blank or text is not blank and combo boxes are blank.

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

@KrishnaV, regrettably same result as before.  Only working when both comboboxes and textinput have values within.

Community Support
Community Support

Hi @enlitzinger ,

 

Please try this on

Filter(
'Standards, Disclaimers & Disclosures',
If(IsEmpty(ComboBox1.SelectedItems),true, 'Review Element(s)' in Concat(ComboBox1.SelectedItems,Result&",")) ||
If(IsEmpty(ComboBox2.SelectedItems),true, 'Subject Matter or Content Topic(s)' in Concat(ComboBox2.SelectedItems,Result&",")) ||
If(IsBlank((TextInput1),true, TextInput1.Text in 'Required Language'
)

Hope this helps.

Sik 

Regrettably receiving an error related to the last part of the formula:

 

||
If(IsBlank((TextInput1),true, TextInput1.Text in 'Required Language'
)

 

It's stating 'an invalid number of arguments. Received 3 expected 1.

Hi @enlitzinger ,

 

Sorry for my bad, I miss a ')' in the code, please try this:

Filter(
'Standards, Disclaimers & Disclosures',
If(IsEmpty(ComboBox1.SelectedItems),true, 'Review Element(s)' in Concat(ComboBox1.SelectedItems,Result&",")) ||
If(IsEmpty(ComboBox2.SelectedItems),true, 'Subject Matter or Content Topic(s)' in Concat(ComboBox2.SelectedItems,Result&",")) ||
If(IsBlank((TextInput1),true, TextInput1.Text in 'Required Language')
)

Hope this helps,

Sik

View solution in original post

Hi @enlitzinger ,


I just want to follow up with you on this issue to see is it resolved or still you see any challenges.

If you see any challenge/need further help let me know I am always happy to help.

Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (54,089)