Adventure with Canvas Apps: Dynamic-like Survey Engine

Survey App

I recently had an ask to build a Canvas App for entering Surveys.

Surveys consisted of one or more Forms.

The Forms are assigned to a Survey and then filled out in a specified order.

I decide on Dataverse as data store, but could really be anything, SQL Server, and dare I say, SharePoint.

Note, it is not a fully developed solutions, some of the Screens still need some work, but it is enough of a proof of concept to tackle the original ask.

Figure 1 – Components

I’ll briefly touch on what I did, but feel free to dig into the Solution deeper by downloading it at https://mattruma.com/wp-content/uploads/2025/02/Demo1Solution_1_0_0_1.zip.

Let’s get on with it!

Survey builders create a Survey (Demo 1 Survey table), and assign it Screens, or Forms (Demo 1 Screen table), which are stored in the Dataverse table Demo 1 Survey Screen.

Figure 2 – Survey List
Figure 3 – Survey

When a user creates a Survey, a record is added to the Demo 1 Survey Instance table.

I created three Forms, or Screens, called Screen 1, Screen 2 and Screen 3, followed by five different Surveys to give a good sample set for testing.

Each Screen as one more Dataverse tables that collect the data related to it, for example, Screen 1 stores data in Demo 1 Screen 1 Instance and Demo 1 Screen 1 Instance Item.

Figure 4 – Screens

The Screens contained in the Canvas App are:

  • HomeScreen – The starting point of the application, where the user is presented with a list of created Survey Instances, and the ability to create a new Survey Instance.
  • SurveyStartScreen – This starts the process of collecting data related to the Survey Instance.
  • Screen1, Screen2 and Screen3 – The screens used to collect the data for the Survey Instance, each screen is responsible for loading and saving its data.
  • SurveyCompleteScreen – Completes the survey entry.

Figure 5 – Survey Start Screen

The tricky part was figuring out what Screens to navigate to as the user moved through the survey.

I first mapped a Formula variable called AvailableScreens, to the name of the Screen as would be found in the Dataverse table and the actual Screen.

I would use this to lookup Screens based on then friendly name of the Screen.

Figure 6 – AvailableScreens Formula

Here is the code for figuring out which Screen the survey should start with.

Each Screen has a Previous and Next button, with the Next button containing the functionality to store the data and navigate to the next Screen.

Here is the code for the Next button on Screen1.

Here is the code for the Previous button on Screen1.

Screen creation follows a similar pattern.

  1. Add a record to the Demo 1 Screen table.
  2. Add supporting tables to store the data for each Screen.
  3. Create the Screen in the Canvas App
  4. Add a mapping to the AvailableScreens.
  5. Add Next and Previous button, and update with standard navigation code.

There are few more nuances, but that is the general approach.

Another way I might tackle this ask, would be to create multiple apps, and daisy chain them together using the URL of the Canvas App, the challenge here is it might lead to some longer load times moving between Canvas Apps.

You also want to be mindful of the number of Screens and Controls on each Screen, this may cause some performance issues.

Again, check it out for yourself at https://mattruma.com/wp-content/uploads/2025/02/Demo1Solution_1_0_0_1.zip.


Discover more from Matt Ruma

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *