Resco Inspections on Power Platform
| Warning | Work in progress! We are in the process of updating the information on this page. Subject to change. |
Traditionally, end users consume questionnaires in Resco mobile apps. Since Release 16.1 (summer 2023), questionnaires can also be used in various components of the Microsoft Power Platform: Power Apps and Power Pages.
As your backend server, use Microsoft Dataverse - with or without extra Dynamics features.
Prerequisites
Here's a high-level overview of steps to prepare your environment:
- Go to https://make.powerapps.com/.
- Install the Woodford managed solution. (How?)
- Use the Questionnaire Designer to create and publish at least one questionnaire.
Why Woodford
In this scenario, the Woodford tool is not used. So why is the Woodford solution needed? It includes several other components necessary for inspections:
- Custom tables, e.g., questionnaire
- Questionnaire Designer, the backend tool for designing and managing questionnaire templates
- Several standard views for the questionnaire table, as well as a custom form - the Questionnaire Player web resource. These can be used on the Power Platform.
Power Apps
The Questionnaire table can be easily integrated into your Power Apps with only a few clicks. Treat Questionnaire just like a standard Dataverse table, with the Questionnaire player replacing the standard table form.
Power Pages
Microsoft Power Pages is a platform for creating, hosting, and managing websites. The following example explains how to include the Questionnaire Player on a webpage in a few steps:
- Prepare a special app project in Woodford.
- Create a Power Page and add the Questionnaire Player
- Set up permissions for tables necessary for the Questionnaire Player
- Grant web API access for the same tables
Create a dedicated app project
For version 1.0 of the Power Pages Questionnaire Player, it is essential to have a mobile project in Woodford that is configured to work with Inspections and is named "PPInspectionsPlayer". The simplest way to achieve this is by cloning the predefined Inspections project.
Create a Power Page
- Go to https://make.powerpages.microsoft.com/ (Power Pages design studio).
- Ensure you are in the environment with Resco Woodford solution installed.
- Create a new power page or edit an existing one.
- Go to Pages and select the page where you want to add the Questionnaire Player.
- Insert an iframe to the page, then switch to Edit code and use the following code to define the iframe content:
<iframe frameborder="0" id="qplayerIFrame" data-ppid="1565191e-bc3e-7bad-6805-6ffd20a70b42" style="width: 800px; height: 800px; max-width: 100%;"></iframe> - Include the following script within the page:
<script type="text/javascript" src="/_webresource/resco_MobileCRM/PowerPages/inspectionsPlayer.js" data-ppid="3699bcda-72e0-21e0-94cb-71dee05f0691"></script> - Save the modified code, return to Power Page design studio, and click Sync to retrieve the latest code.
Set up table permissions
Add the necessary permissions for the following tables:
- resco_mobileproject – Read access
- resco_mobiledata – Read access
- resco_questionnaire – Read, Write, Update, Delete, Append, Append to
- resco_questiongroup – Read, Write, Update, Delete, Append, Append to
- resco_question – Read, Write, Update, Delete, Append, Append to
- annotation – Read, Write, Update, Delete, Append, Append to
- systemuser – Read, Append, Append to
- webresource – Read, Append, Append to
- Any entity accessible from your questionnaires (e.g., account, contact…)
You can decide what kind of access you want to grant users. Your web can be accessed by anonymous users or authenticated users. The access type might be global or parent, account, or contact. You can learn more about the security model of power pages in official Microsoft documentation. In this document, we describe how to grant access to the mentioned tables for anonymous users.
While editing your site, go to Set up > Table permissions. For each table, repeat the following procedure:
- Click +New.
- Enter the Name of your permission, Website, and the Table Name.
- Set Access Type to "Global".
- Check the required privileges, for example, Read.
- Click Add roles and check role(s) for which the permission is created. In our case, it is Anonymous Users.
- Save all changes.
Set up web API access
Questionnaire Player uses Microsoft Web API service to communicate with the underlying Dataverse organization. You must set the Web API access to the same tables as in the previous step.
- While editing your site, click the ellipsis button in the left pane (just under Set Up) and select Portal Management.
- Select Website > Site Settings from the menu.
- For each table, create two new site settings:
- Enable the web API for this table.
- Set up fields that should be available via web API (or use asterisk for all).
{{#CI form: title = Was this information helpful? How can we improve?
| type = inputs
| [textarea]
}}