cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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

Highlighted
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
Highlighted
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

Highlighted
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?

Highlighted
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

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,640)