cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rakel
Frequent Visitor

Multichoice field to affect further fields

Hi

 

I have an app, which has a multichoice field where users can select several different values. Some of these selected values trigger further fields to be shown. However, if several fields are chosen from the multichoice field, the further fields are only triggered from the last selection

 

Example

Q1 - Select the reasons (multichoice)

Hurry

Schedules

Fatigue

Other

 

Q2 - Hurry/Schedules

Visible If( DataCardValue41.Selected.Value = "Hurry" ||DataCardValue41.Selected.Value = "Schedules", true)

 

Q3 - Other

Visible If(DataCardValue41.Selected.Value = "Other", true)

 

Both work fine, if only one value is selected. If values Hurry, Other are selected (in this order) only Q3 shows up. If the are selected the other way around (Other, Hurry) then Q2 shows up.

 

I would need both fields to show up, if both values are selected. How do i get it to work?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Multichoice field to affect further fields

@Rakel

The property Selected will only work in situations where a single selection is allowed in the ComboBox.  Here's what your code looks like.

 

DataCardValue41.Selected.Value = "Hurry"

 

When multiple selections are allowed in the ComboBox we must check if the text string is IN the SelectedItems.  Change your code to look like this instead.  Apply this technique to all of your conditional statements.

 

"Hurry" in DataCardValue41.SelectedItems.Value

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Super User
Super User

Re: Multichoice field to affect further fields

@Rakel 

You can take this code you wrote for Q2...

 

If( DataCardValue41.Selected.Value = "Hurry" ||DataCardValue41.Selected.Value = "Schedules", true)

 

...and change it to this code instead.  It is not necessary to include the IF function because this code will evaluate to either true or false automatically.

 

"Hurry" in DataCardValue41.SelectedItems.Value || "Schedules" in DataCardValue41.SelectedItems.Value

 

Hopefully this works for you!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Multichoice field to affect further fields

@Rakel

The property Selected will only work in situations where a single selection is allowed in the ComboBox.  Here's what your code looks like.

 

DataCardValue41.Selected.Value = "Hurry"

 

When multiple selections are allowed in the ComboBox we must check if the text string is IN the SelectedItems.  Change your code to look like this instead.  Apply this technique to all of your conditional statements.

 

"Hurry" in DataCardValue41.SelectedItems.Value

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Rakel
Frequent Visitor

Re: Multichoice field to affect further fields

Perfect!

 

If i need Q2 to show up from both/either selection of "Hurry" or "Schedule", how do i reform the statement?

Super User
Super User

Re: Multichoice field to affect further fields

@Rakel 

You can take this code you wrote for Q2...

 

If( DataCardValue41.Selected.Value = "Hurry" ||DataCardValue41.Selected.Value = "Schedules", true)

 

...and change it to this code instead.  It is not necessary to include the IF function because this code will evaluate to either true or false automatically.

 

"Hurry" in DataCardValue41.SelectedItems.Value || "Schedules" in DataCardValue41.SelectedItems.Value

 

Hopefully this works for you!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,197)