Import And Export Data In Microsoft PowerApps

Before reading this article, please go through some important articles given below.

In PowerApps, we can add import and export control.

Import and Export Control

Import and export controls are used to export the data to a local file and then import that data into another app in PowerApps. If you want to use the same data in more than one app, we can use export and import, using an export control and an import control.

When you export data, you create a compressed file, which you can copy to another machine, but you can't read it in any program other than PowerApps.

Follow the steps, mentioned below, to work with import and export control in PowerApps.

Step 1. Log into the PowerApps.

After downloading PowerApps from the Windows store, we need a Microsoft-related organization’s Office 365 ID (MSDN, Microsoft, Skype, Office 365, etc.,) to log in with it.

PowerApps

Step 2. Create a New App in PowerApp.

After login, we can see the Dashboard. We need to click on the New button.

Dashboard

Step 3. Choose the Blank app.

Blank app

Step 4. Designing the App.

Now, let's start designing the app. On the left side, we can see the Individual Screens to add our data. On the right side, we see the list of layouts. On the top, we see the formula bar.

On the right side, we see the Add data source to add the external data source.

Designing the App

Step 5. Drag and Drop the Button Control.

  1. Go to the Insert menu, followed by controlling and dragging the button tool.
     Insert menu
  2. Drop the Button tool on the Screen.
    Drop the Button tool
  3. Add the Coding
  4. Select the button and add the data for the button to the OnSelect event.
    ClearCollect(Product, 
        {Name: "Soap", Price: "30"}, 
        {Name: "Powder", Price: "20"}, 
        {Name: "Cream", Price: "50"}
    )
    
    ClearCollect

Step 6. Drag and Drop the Export Control Tool.

If you select the options, then we can export the data.

  1. Go to the Insert menu, followed by choosing controls, and drag the export control.
    Export control
  2. Drop the export control to the screen.
    Drop the export control
  3. Add coding.
  4. Select the export control and set the data event to the product.
    Data event

Step 7. Drag and Drop the Import Control Tool.

If you select the options, then we can export the data.

  1. Go to the Insert menu, choose controls, and drag the import control.
    Choose controls
  2. Drop the import control to the screen.
    Import control
  3. Rename the control.
    Rename the control
  4. Add Coding
  5. Select the import control and add the coding to the OnSelect event.
  6. Coding.
    Collect(ImportedProduct, MyData.Data)
    
    Coding

Step 8. Run the app.

Run app

Output 1. The main screen is shown below.

Main screen

Output 2. Click on the export control.

PowerApps output

Output 3. Choose the folder to export and click the save button.

Save button

Output 4. Click on the import control.

PowerApps control

Output 5. Choose the folder, where the file is required to be imported and click Open.

File is required

Conclusion

I hope you understand how to add import and export control in Microsoft PowerApps and how to run it.


Similar Articles