cancel
Showing results for 
Search instead for 
Did you mean: 

Move or Copy a SharePoint list PowerApps Custom Form

It would be nice to be able to create a SharePoint list PowerApps Custom Form in one site or list (e.g. development) and then be able to move it to another site or list (e,g, production). This would help with development and teting of new and updated forms before they are released to the production. This could also help with the reuse of form designs, so a person isn't always recreating the wheel.

Status: Started
Comments
Level: Powered On

@Audrie-MSFT . Still no trace of this feature on the Planned Features list (https://docs.microsoft.com/en-us/business-applications-release-notes/April19/microsoft-powerapps/pla...). Do you have any updates since last summer since that's when this idea got changed to "Planned"?

Level: Powered On

Hi Power Apps Team, 

Any update on  the developemnt of this feature?

Level: Powered On

Hi, I need to desing a form which is bit time consuming and I need to implement for few lists in same site. I tried to export,change json file but during import I recevied errors. Is that possible in same site?

 

Thanks,



 

Level 10

Hi @hasannumanoglu,

If you want to replicate a form from one list A to another list B in the same site collection, yes it should be possible. You will have to make sure, though, that boths lists have the exact same structure.

Then, extract your form when on list A, unpack the ZIP file, change the title of the application in the JSON files and replace all list A ID with list B ID (and check urls as well). That should do the trick...

Emmanuel

Level: Powered On

 

Hi @egallis ,

 

To be honest I tried that but let me give more detail. I exported form as a new app, download the zip file, extract and changed the json file , please see below. Zipped again tried to import but I am reveiving "Something went wrong. Please try again later" error, no specific reason on the error code.. There is no title section in json but please check below;

 

{
  "schemaVersion": "1.0",
  "appDefinitionTemplate": {
    "id": "/providers/Microsoft.PowerApps/apps/",
    "type": "Microsoft.PowerApps/apps",
    "tags": {
      "minimumRequiredApiVersion": "2.2.0"
    },
    "properties": {
      "appVersion": "2019-05-07T14:16:52Z",
      "lifeCycleId": "Published",
      "createdByClientVersion": {
        "major": 3,
        "minor": 19044,
        "build": 15,
        "revision": 0,
        "majorRevision": 0,
        "minorRevision": 0
      },
      "minClientVersion": {
        "major": 3,
        "minor": 19044,
        "build": 15,
        "revision": 0,
        "majorRevision": 0,
        "minorRevision": 0
      },
      "backgroundColor": "rgba(0, 176, 240, 1)",
      "backgroundImageUri": "/7292670920347623604/N39078ca8-209c-44a9-8f96-546c0e04faf1-logoSmallFile",
      "displayName": "THIS PART CHANGED forms",
      "description": "",
      "appUris": {
        "documentUri": {
          "value": "/7292670920347623604/N6f3e5d04-defb-4e69-bac6-49e81521ca2f-document.msapp",
          "readonlyValue": "/7292670920347623604/N6f3e5d04-defb-4e69-bac6-49e81521ca2f-document.msapp"
        },
        "imageUris": []
      },
      "createdTime": "0001-01-01T00:00:00Z",
      "lastModifiedTime": "0001-01-01T00:00:00Z",
      "sharedGroupsCount": 0,
      "sharedUsersCount": 0,
      "icons": {
        "smallIconUri": "/7292670920347623604/Nb9ea504f-8199-4025-a9ad-d5ac904b1082-small.png",
        "mediumIconUri": "/7292670920347623604/N1ab70d2f-df6a-4462-bed6-29a203601e15-medium.png",
        "largeIconUri": "/7292670920347623604/Nc3545288-7b4a-4b62-8017-2256c43682cd-large.png",
        "wideIconUri": "/7292670920347623604/Ne8ffe8d7-ae59-4051-aad3-3cb63958f673-wide.png"
      },
      "connectionReferences": {
        "ef011beb-ecdb-4912-960c-bdd711bb2149": {
          "id": "e0b87445-97de-4224-97eb-a0793922ca7e",
          "displayName": "SharePoint",
          "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1008.1183.png",
          "dataSources": [
            "LAF Asset"
          ],
          "dependencies": [],
          "dependents": [],
          "parameterHints": {},
          "isOnPremiseConnection": false,
          "bypassConsent": true,
          "dataSets": {
            "https://XXX.sharepoint.com/sites/XXXX/XXX{
              "dataSources": {
                "LAF Asset": {
                  "tableName": "THIS PART CHANGED",
                }
              }
            }
          },
          "apiTier": "Standard",
          "isCustomApiConnection": false
        }
      },
      "embeddedApp": {
        "siteId": "https://XXXXX.sharepoint.com/sites/XXXXXX/XX",
        "listId": "THIS PART CHANGED",
        "listUrl": "THIS PART CHANGED",
        "type": "SharepointFormApp",
        "screenWidth": 1185,
        "screenHeight": 790
      },
      "almMode": "Environment"
    }
  }
}

Level: Powered On

Hi @egallis ,

 

Thanks, I found that the online json editor, adds some spaces to the file and that cause an upload problem. Also found another issue, zip-unzip packet creates a problem, so I edit the file directly in zip file. Now I can upload... It can be great, if that function works in basic way Microsoft...

 

Thanks,



 

Level 10

Hi @hasannumanoglu,

Good to hear...

About your zip-unzip problem, it is probably due to the software you use. The only one I could find that would work for PowerApps packages is 7-zip (using all default parameters). Try it. It works for me...

Emmanuel

Level: Power Up

Howdy,

 

I have not been able to get the edited .json steps to work. I'm quite comfortable in SharePoint and coding so i've been careful and accurate. Something isn't working and it won't allow an upload of the package.

 

Tried all lowercase GUIDs

Tried multiple times to eliminate the possibility of human error on entry

 

Is there any other method, however ugly, to get this to work? I've created and fully tested a PowerApp List form in our development environment. I'm left without options now. I assumed it would stay with the library/list during migration as InfoPath used to do. Or if not, I assumed it would have a workaround that works. Who WOULDN'T need this feature if they are creating apps?

 

I don't think I would release PowerApps SharePoint List cusomtization without it, i would've pumped the brakesthere because it's so core. it's like selling a car without the tires.

 

If anyone can help me I'd be super grateful, otherwise i look forward to a time when there's a tool for this 🙂  have a great day all,

 

-Logan

Level 10

Hi all,

Since many of you seem to encounter different problems when it comes to transporting or duplicating a SharePoint form from one place to another, I'll take some time here to describe the procedure in details (which, by the way, works fine for me for customized SharePoint forms AND for canvas PowerApps applications). I'll discuss also the use of PowerApps environments.

The most common case (I suppose) is when you wish to copy a SharePoint form customized with PowerApps from one site collection (i.e. DEVELOPPEMENT) to another (i.e. VALIDATION). Globally speaking, there are 4 steps to do so:

  1. Extract your SharePoint form from PowerApps into a ZIP file
  2. Convert your ZIP file to replace all DEV urls and GUIDs with VAL urls and GUIDs
  3. Import your converted ZIP file into PowerApps
  4. Publish the imported form

I. Extracting the SharePoint form

In this step you will extract the SharePoint customized form from your source (i.e. DEV site collection) using PowerApps native EXPORT feature to produce a ZIP file. Here is what you have to do:

  1. Go to the SharePoint list where you have your customized form that you wish to copy/transport
  2. From the gear menu, choose the List settings option
  3. In section General settings click on the Form settings link
  4. There you should have the second radio button checked (Use a custom form created in PowerApps...)
  5. Right under this radio button you will see some links. Click on the link called See versions and usage
  6. You will then be redirected to PowerApps on your form's details page
  7. There, click on the Export package (preview) button. You are redirected to the export package page.
  8. Give a name to your package (I prefer to use only alphanumeric characters here, no spaces, dashes and underscores... just in case). Let's say I call it MyForm.
  9. Don't touch anything else (even the IMPORT SETUP parameter which, in any case, will be prompted again during the import phase)
  10. Just click the Export button
  11. Your package is generated and the system shows up a file dialog box so you can save your ZIP file (by default, the system names it: <name in step 8>_AAAAMMDDHHmmss.zip); so in my example, its name is MyForm_20190514201458.zip). Feel free to give it another name of course.

II. Converting the package

Now comes the interesting part: replacing all source site collections urls and GUIDs in the package with all destination urls and GUIDs.

To do so, I use the following tool found on Github: FlowPowerAppsMigrator (many thanks to Zerg00s for this wonderfull tool). For your information, I have fixed one or two bugs in this tool. The fixed version can be found here (I'll try to find some time one day to update it directly on Github).

One last thing: as it is explained on the Github tool's page, it uses the PnP-PowerShell framework. All links and instructions can be found on the tool's page. The instructions below suppose your have already installed the PnP-PowerShell framework and unpacked the FlowPowerAppsMigrator tool.

So let's go convert our ZIP file:

  1. Let's say the FlowPowerAppsMigrator tool is located in the Downloads\FlowPowerAppsMigrator folder on your PC
  2. Go to that folder and copy your package ZIP file (in my case MyForm_20190514201458.zip) into the src subfolder
  3. Open a Windows PowerShell window (I personally perfer PowerShell ISE for its intellisense feature)
  4. Go to the Downloads\FlowPowerAppsMigrator folder
  5. Run the script .\RunAllScripts.ps1
  6. The script will first prompt you for the source SharePoint site url: for example https://mytenant.sharepoint.com/sites/DEV
  7. After a while the script will produce a CSV mapping file
  8. Then the script will prompt you again, now for the destination SharePoint site url: for example https://mytenant.sharepoint.com/sites/VAL
  9. After a while, the script will start the conversion procedure. But just before it actually converts your package, it will show you the old name of your form app and prompt you for a new name. I always choose here another name for my form app, like: MyForm-VAL.
  10. Then the conversion will take place: the script will open all JSON files that it will find inside your package (even the ones located into the MSAPP file) and replace for you all source urls and GUIDs with the destination ones. Coooool ! No need to do it manually anymore (such a pain !).
  11. Once the script ends go to the dist subfolder of the migration tool. There you will find your converted package named Converted_<name of your original file>.zip.

III. Importing the converted package

Now we are ready to import the new package in PowerApps. At this point, if you have different environments in PowerApps, choose the environment you want to import it in.

Note: prior to importing your converted package, all customized forms on the target list must be removed. To do so:

  1. Go to your target list settings page
  2. Click the Form settings link
  3. Check the Use the default SharePoint form radio button
  4. Save your changes by clicking the OK button
  5. Go back to the Form settings page and click the Delete custom form link and confirm the dialog box

Now you are ready to proceed with the import procedure:

  1. Go to PowerApps
  2. Choose your target environment if needed (but you can also import you converted package into the same environment as the one you did the extraction operation)
  3. In the left menu, go to Applications
  4. Click the Import package (preview) button
  5. Click the Download button and select your converted package ZIP file located in the dist folder of the migration tool
  6. Let PowerApps load your package
  7. Once loaded you will be redirected to a page when you will see the details of your package
  8. In the Review Package Content section, click on the red exclamation mark icon in front of your source app name (you could also click on the Update link or the Action wrench icon)
  9. There, in the Setup dropdown, choose the Create as new option (the Update operation is not yet suported when importing SharePoint customized forms; it is only supported for Canvas or model-driven PowerApps apps)
  10. In the Resource name text box, enter another name for your app (otherwise it won't import); for example: MyForm-VAL.
  11. Click the Save button
  12. Click the Import button
  13. That's when you pray that all goes fine... Smiley Happy
  14. Once the import procedure is over, stay on that page for the last global step below

Note: if you forget to remove your old customized form from your target list before importing your converted package, the next time you will do the import procedure you will have to provide a new resource name for your app (the one specified at step 10: by example MyForm-VAL-2). In fact, everytime you will do an import of a new version of your form, you will have to give it a new name because PowerApps creates a new app everytime (unless you manage to remove completely the previous app using the PowerApps cmdlets available here).

IV. Publishing the newly imported form

Now that your form has been imported into your target site collection, you just need to publish it to make it active. So just:

  1. On the page that says you imported your package successfully, click on the Open application link
  2. Once in the PowerApps editor for your imported customized form, just check that all datasources point to the correct target location and do a quick refresh on each datasources, just to be sure Smiley Happy
  3. Do a fake modification in your form (a small change with no impact on your form) so the Save button is available in the File menu, save it and publish it (you HAVE to publish it so it becomes active on your target list)

Well... I hope this will help you guys in your deployment procedures for customized SharePoint forms. If you have any questions or remarks, feel free to do so...

Emmanuel

PDA
Level: Powered On

@egallis 
Thanks A LOT !
This workaround here is exactly what should, in my opinion, be implemented by MS teams.

I have one app that uses 7 SharePoint Lists on 2 different SP Sites, and this is for every client I have. Keeping in mind that at some point PowerApps will be open to non-organisation users, I wanted to keep the logic "one client - one DB".

Anyway when developping, every time I was deleting and adding my datasources manually to go from "test" to "Client1-Prod", it also deleted the DropDown Data DisplayFields that somehow couldn't display "Value" on its own if you filtered the items with an "if" condition.

Well anyway I think it's a huge pain you withdrew, I couldn't find anything on the forum so try to post it somewhere on a blog or something ?

Once again thanks a lot !