Canvas Apps
How to Export & Import Canvas Apps

How to Export & Import Canvas Apps

Deploying artifacts from one environment to another is an integral part of application life cycle management. If the development is carried out in solutions (which is the recommended way) all the flows and apps can be exported and imported in one installment.

Previously we saw how to import flows individually, In this post we will see how to export and import the canvas app and its related connectors.

While importing the artifacts to the production environment, it is advisable to log in with “Service Account”. Because all the connections will be created as signed-in user permissions.

1.1 SharePoint customized forms – New

If the SharePoint list is customized it will create the app in the default environment (Upgrade), unlike normal canvas apps we cannot directly import to another environment because internally it will be mapped to the current list.

Navigate to the versions page and export the app

So after exporting it we need to make some changes in JSON, to map it to the destination list.

Check the file path in the below screenshot for the JSON file and what to change is pointed out.

Import the zip file in which the JSON is modified to the destination environment and make sure to change the “Resource name” while importing.

Open the destination list and select the customized form

Datasource is not connected and still pointing to the source list in the deployed app, So it should be changed to the destination list. Don’t replace the cards it will remove all the customizations made previously.

Replace all the source list data source names with the destination data source.

If there are more Single line of text columns then all the data cards will have the “Max length” property and it should be changed.

Max Length Property

Once all the changes are completed, publish the app.

1.2 SharePoint customized forms – Update

Now adding a workflow in the source list and it should be moved to the Destination list.

Export the package as “Create as New” or “Update” it does not matter.

Export the updated package

Delete the form in the destination list otherwise, it will throw an error like already an app exists there.

Delete form

Import the package, change the “resource name” and change the type as “Create as New”.

Once deployed, change the data source name, as we see the workflow is added and make sure the workflow is turned on.

2.1 Canvas App – New

In the canvas app, we don’t have to change the JSON because it is not dependant on any of the lists. Here the app can be exported across the environments. In the below example it is clearly shown the app is exported from “Dev” environment and imported to the “QA” environment.

Select the type as “Create as New” while exporting the app

Once the app is deployed open the app and remove the Source list datasource and change it with destination list data source.

Destination Data source changed

2.2 Canvas App – Update

In the source app, we added a workflow and exported the app setup as “Update”

While importing the app in the “QA” environment it will ask to select an app in which it has to be updated.

Once deployed replace the source datasource with the destination datasource.

Make sure to turn on the workflow, by default it will be turned off.

This will be suitable for the small app with one or two workflows. The recommended way is to use solutions for development as it makes the deployment easier. We have already published a post on how to deploy the flows.

Please post your queries in the comments section. Happy Building šŸ™‚

0

Leave a Reply

%d bloggers like this: