Export control and Import control in PowerApps

Controls for exporting data to a local file and then importing that data into another app in PowerApps.

Description

If you want to create more than one app that uses the same data but not share that data outside those apps, you can export it and import it by using an Export control and an Import control. When you export data, you create a compressed file that you can copy to another machine, but you can't read it in any program other than PowerApps.

Warning

Enabling this functionality in your app may expose it to security vulnerabilities and data leakage. It is recommended to advise users to import only recognized and trusted files and only export data that is not confidential or sensitive.

Key properties

Data – The name of a collection that you want to export to a local file.

  • The Data property is available for an Export control but not an Import control.

OnSelect – How the app responds when the user taps or clicks a control.

Additional properties

Align – The location of text in relation to the horizontal center of its control.

BorderColor – The color of a control's border.

BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – The thickness of a control's border.

Color – The color of text in a control.

DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.

DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.

DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.

Fill – The background color of a control.

Font – The name of the family of fonts in which text appears.

FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.

Height – The distance between a control's top and bottom edges.

HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.

HoverFill – The background color of a control when the user keeps the mouse pointer on it.

Italic – Whether the text in a control is italic.

Padding – The distance between the text on an import or export button and the edges of that button.

PressedBorderColor – The color of a control's border when the user taps or clicks that control.

PressedColor – The color of text in a control when the user taps or clicks that control.

PressedFill – The background color of a control when the user taps or clicks that control.

RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.

RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.

RadiusTopLeft – The degree to which the top-left corner of a control is rounded.

RadiusTopRight – The degree to which the top-right corner of a control is rounded.

Size – The font size of the text that appears on a control.

Strikethrough – Whether a line appears through the text that appears on a control.

Text – Text that appears on a control or that the user types into a control.

Underline – Whether a line appears under the text that appears on a control.

VerticalAlign – The location of text on a control in relation to the vertical center of that control.

Visible – Whether a control appears or is hidden.

Width – The distance between a control's left and right edges.

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Example

  1. Add a Button control, and set its OnSelect property to this formula:
    ClearCollect(Products, {Name:"Europa", Price:"10.99"}, {Name:"Ganymede", Price:"12.49"}, {Name:"Callisto", Price:"11.79"})

    Don't know how to add, name, and configure a control?

    Want more information about the ClearCollect function or other functions?

  2. Press F5, click or tap the Button control, and then press Esc.
  3. Add an Export control, and set its Data property to Products.
  4. Press F5, click or tap the Export control, and then specify the name of the file into which you want to export the data.
  5. Click or tap Save, then press Esc to return to the default workspace.
  6. In a new or existing app, add an Import control, name it MyData, and set its OnSelect property to this formula:
    Collect(ImportedProducts, MyData.Data)
  7. Press F5, click or tap MyData, click or tap the file that you exported, and then click or tap Open.
  8. Press Esc, click or tap Collections on the File menu, and confirm that the current app has the data that you exported.