cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous, 

 

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

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 @Anonymous, 

 

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

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

 

Anonymous
Not applicable

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

Anonymous
Not applicable

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,130)