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.
Step 2. Create a New App in PowerApp.
After login, we can see the Dashboard. We need to click on the New button.
Step 3. Choose the 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.
Step 5. Drag and Drop the Button Control.
- Go to the Insert menu, followed by controlling and dragging the button tool.
- Drop the Button tool on the Screen.
- Add the Coding
- 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"}
)
Step 6. Drag and Drop the Export Control Tool.
If you select the options, then we can export the data.
- Go to the Insert menu, followed by choosing controls, and drag the export control.
- Drop the export control to the screen.
- Add coding.
- Select the export control and set the data event to the product.
Step 7. Drag and Drop the Import Control Tool.
If you select the options, then we can export the data.
- Go to the Insert menu, choose controls, and drag the import control.
- Drop the import control to the screen.
- Rename the control.
- Add Coding
- Select the import control and add the coding to the OnSelect event.
- Coding.
Collect(ImportedProduct, MyData.Data)
Step 8. Run the app.
Output 1. The main screen is shown below.
Output 2. Click on the export control.
Output 3. Choose the folder to export and click the save button.
Output 4. Click on the import control.
Output 5. Choose the folder, where the file is required to be imported and click Open.
Conclusion
I hope you understand how to add import and export control in Microsoft PowerApps and how to run it.