
Announcements
This is a "how to", rather than a question.
I recently had the need to create a survey that would display different questions depending on a parameter passed in a URL (if launching from a "deep-link"), or display the app in Teams (where you can't pass parameters). So, if the app is running in a browser, you get the survey with the right questions. If the app is running in Teams, you land on a different screen (for editing survey responses and providing response metrics).
There are three main difficulties to overcome:
1. Conditional navigation isn't allowed in an App OnStart property, making it difficult to jump to the right screen depending on whether or not the parameters exist.
2. You need to have a menu that exists on all of the question pages that allows you to navigate to any questions in the selected question set (since the question set would be different, depending on the parameter received).
3. While it's easy to "direct code" a table to act as a list of questions to ask, by using a "question set" (retrieved from Dataverse), you can't direct-code the table or collection. It has to be built "on the fly" based on whichever question set is selected in the URL.
Doing this required the combination of different sources of help:
#1 was overcome by using a trick. See Re: Why we can not use Navigate() in OnVisible - Page 2 - Power Platform Community (microsoft.com). In my comment there, see how to use a "mode" screen with a timer control to choose which screen to start on.
#2 was overcome by implementing a "Sidebar Menu Component" (except for the problem in #3). See Matthew Devaney's excellent post at Power Apps Navigation Menu Component - Matthew Devaney
#3 was overcome by creating a couple of tables in Dataverse, along with some code on the SurveyStart page OnVisible property:
The first Dataverse table, "ThreatConQuestionSets":
Has a QuestionID (text), QuestionSetName (text), TCQuestions (same as QuestionID, but has a lookup to the other table), SetID (text)
The second Dataverse table, "ThreatConQuestions":
Has a QuestionID (the lookup destination for TCQuestions in the other table, which is also the screen name of that question), Icon (for displaying in the menu component), and a Question column (which is unused, but helps me remember what the actual question is for any QuestionID)
@korebreach - thanks for this. Have you considered creating a post on the Community Blog?
https://powerusers.microsoft.com/t5/Community-Blog/ct-p/PA_Comm_CommunityBlog
I would recommend reaching out to @heaher_italent or @DuaneM_iTalent to obtain approval for creating Community Blog posts.