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

How to get form questions to use branching/logic

I have a form that I created from a SharePoint list on PowerApps and I want to be able to use branching to only show some questions depending on the answer from a previous question. How do I make this possible?

 

In my example, if the user selectes Knowledge Base/The Store I want it to show the question below, but if they select any of the other two answers I want it to show the next questions after that.Power.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
ericonline
Community Champion
Community Champion

Hi @Sammy

 

Here is one option for the form fields you want to appear/disappear: 

  • Click the form field (card) you want to appear/disappear
  • Set the .Visible property of the card to: 
  • If(
    <whtever_your_dropdown_is_named>.Selected.Value = "Knowledge Base/The Store",
    true,
    false)

This will hide the selected card unless the user chooses Knowledge Base/The Store from the previous dropdown. You will likely run into issues with the fields moving all over the place (aka chaos!). 

 

Study this resource and this post to develop a strategy for handling said chaos. While you're at the post, you might consider voting to have cards "locked" where users put them.

 

Take care

View solution in original post

wyotim
Resident Rockstar
Resident Rockstar

*Edit: A little late to the show!*

 

Maybe use the Visible field on each question to either show or hide based on which option is selected? Something along the lines of this:

 

If(
     DropdownName.Selected.Value = "Knowledge Base/The Store",
     true,
     false
)

For the other two options, maybe use an Or statement with the same structure for the related questions, assuming that the same questions apply to both of those selections. 

 

If(
     DropdownName.Selected.Value = "Banking Script Centre" || DropdownName.Selected.Value = "GI Call Guides",
     true,
     false

 

View solution in original post

7 REPLIES 7
Shanescows
Super User
Super User

For each card you want to show or hide you need to change the Visible property. Use an If and only make it visible when you want to show it. Then trigger it as you go. In this video I did exactly this but for a different reason if you are struggling with how that works. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
ericonline
Community Champion
Community Champion

Hi @Sammy

 

Here is one option for the form fields you want to appear/disappear: 

  • Click the form field (card) you want to appear/disappear
  • Set the .Visible property of the card to: 
  • If(
    <whtever_your_dropdown_is_named>.Selected.Value = "Knowledge Base/The Store",
    true,
    false)

This will hide the selected card unless the user chooses Knowledge Base/The Store from the previous dropdown. You will likely run into issues with the fields moving all over the place (aka chaos!). 

 

Study this resource and this post to develop a strategy for handling said chaos. While you're at the post, you might consider voting to have cards "locked" where users put them.

 

Take care

View solution in original post

wyotim
Resident Rockstar
Resident Rockstar

*Edit: A little late to the show!*

 

Maybe use the Visible field on each question to either show or hide based on which option is selected? Something along the lines of this:

 

If(
     DropdownName.Selected.Value = "Knowledge Base/The Store",
     true,
     false
)

For the other two options, maybe use an Or statement with the same structure for the related questions, assuming that the same questions apply to both of those selections. 

 

If(
     DropdownName.Selected.Value = "Banking Script Centre" || DropdownName.Selected.Value = "GI Call Guides",
     true,
     false

 

View solution in original post

Sammy
Helper IV
Helper IV

Thanks for everyones reply. I have tried this approach but I am still having issues. When I tried to put the string in, it gave me an error message so I took out "Selected" and just kept .Value in. This took away the error message but the visibility is not working the way it should. When I have selected the option "Knowledge Base/The Store" I should get a question directly below it called "Page on the Knowledge Base/The Store referred to" which is where I have put the visibility property in.

 

See screenshots:

 

Power.pngPower1.png

Please ignore this previous reply from me. My error was I was using the car name rather than the dropdown name. When I changed it to the dropdown name it worked.

 

Thanks everyone!

I have the the visibility portion down but what if I want it to "go to"? For instance, If Option C is selected, go to DataCard3.

Anonymous
Not applicable

Lots of great answers already to this question. I thought I would just add for anyone who prefers to watch a video tutorial on the subject, I recently posted something that explains how to do this in its basic form. 

 

https://youtu.be/PoKDvUaqn-k

 

Hope this helps anyone who is struggling with this concept.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (16,099)