web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display a different sc...
Power Apps
Answered

Display a different screen based on question responses

(0) ShareShare
ReportReport
Posted on by 36

Hi,

 

I'm new at power apps and built a form based on a list of sharepoint questions. I was hoping to get some help with a couple more things. 

 

I have a series of 6 yes/no questions that if any of them are "yes", it sends the user to a different screen. If they are all no, it sends them to different screen.  How would I accomplish this?

Categories:
I have the same question (0)
  • Anchov Profile Picture
    1,986 on at

    Are your questions in a gallery component or just placed on the screen without a gallery?  If not in a gallery, its pretty straight forward, it will go something like this:

     

     

    If(comQuestion1.Selected.Value = "Yes" || comQuestion2.Selected.Value = "Yes" || comQuestion3.Selected.Value = "Yes" || comQuestion4.Selected.Value = "Yes" ||comQuestion5.Selected.Value = "Yes" || comQuestion6.Selected.Value = "Yes", Navigate('Yes Screen), Navigate('No Screen'))

     

     

    If its a gallery, its a bit different, but similar.

     

  • therawb Profile Picture
    36 on at

    The source of the questions is a sharepoint list. It appears when imported it put them into a "form" component. 

     

    Example question: "When was the last time you saw this person?_DataCard1". Below this question there's a "toggle". Would it be the same?

  • therawb Profile Picture
    36 on at

    There's also a submit button at the bottom of the page with the values,

     

    If(Form1.Valid,SubmitForm(Form1);NewForm(Form1);Navigate(Screen3),Notify("Please enter the Required fields",NotificationType.Error));

     

     

  • Anchov Profile Picture
    1,986 on at

    Yes, it would be very similar with a Form with Toggle switches.  Syntax is a little simpler since they  just return a true \ false values.  something like:

     

     

    If(togQuestion1 || togQuestion2 || togQuestion3 || togQuestion4 ||togQuestion5 || togQuestion6, Navigate('Yes Screen), Navigate('No Screen'))

     

     

      togQuestion1, togQueston2, … etc. would be replaced by the name of your Toggle controls in your form.

     

    This evaluation would go after your SubmitForm function in your save button.  I typically place this in your form's OnSuccess property.

    or you can modify your If function like:

     

    If(Form1.Valid,SubmitForm(Form1); If(togQuestion1 || togQuestion2 || togQuestion3 || togQuestion4 ||togQuestion5 || togQuestion6, Navigate('Yes Screen), Navigate('No Screen')),Notify("Please enter the Required fields",NotificationType.Error));

     

  • therawb Profile Picture
    36 on at

    Where would 

    If(togQuestion1 || togQuestion2 || togQuestion3 || togQuestion4 ||togQuestion5 || togQuestion6, Navigate('Yes Screen), Navigate('No Screen'))

    these go?  

  • Anchov Profile Picture
    1,986 on at

    I edited my previous response, you could put it here:

     

    If(Form1.Valid,SubmitForm(Form1); If(togQuestion1 || togQuestion2 || togQuestion3 || togQuestion4 || togQuestion5 || togQuestion6, Navigate('Yes Screen'), Navigate('No Screen')),Notify("Please enter the Required fields",NotificationType.Error));

     

     


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @therawb, could you try the code below on the OnSelect of your Form Submit button:

     

    //Submit form
    SubmitForm(Form1);
    
    //Save Last submit record
    UpdateContext({varLastRecord: Form1.LastSubmit});
    
    //Check the answers
    If(varLastRecord.Column1 || varLastRecord.Column2 || varLastRecord.Column3 || varLastRecord.Column4 || varLastrecord.Column5 || varLastRecord.Column6, Navigate(Screen1), Navigate(Screen2))

    Screen 1 -> Yes screen, Screen 2 -> No screen. After saving the form, the user will be guided to the correct page.

    (Replace the .Column with the correct SP column sames.)

     

    @Anchov during my testing, referencing the actual toggle did not work in case of a 'New' form, because the toggle disappears after submit and returns a false value. To avoid this, we first fetch the last response in a variable and reference the columns values of that record.

     

    I hope this helps!

  • therawb Profile Picture
    36 on at

    So 

    varLastRecord.Column1

    would be the coumns in sharepoint that contain the toggle?

  • LaurensM Profile Picture
    12,516 Moderator on at

    @therawb correct. The actual column name in SP which is most likely a yesno column.

    varLastRecord.YesNoColumn1 || ...

  • therawb Profile Picture
    36 on at

    Should I take the column names as they are from sharepoint or use the value assigned to the form? It turns them into a data card (ex: When was the last time you saw this personDataCard1

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard