pacx settings import - neronotte/Greg.Xrm.Command GitHub Wiki

(Preview) Imports settings from an Excel or JSON file.

Usage

This command can be used to import settings from an Excel or JSON file. You don't need to specify the format of the file, as it will be automatically detected based on the file contents.

JSON file

The structure of the JSON file should be equal to the one generated by pacx settings export command, and should be similar to the following example:


[
  {
    "uniquename": "AllowNotificationsEarlyAccess",
    "displayname": "In-app notifications",
    "description": "Enables the app to poll for new in-app notifications and display those notifications as a toast or within the notification center.",
    "datatype": "Boolean",
    "isoverridable": true,
    "overridablelevel": "App And Organization",
    "isvisible": true,
    "releaselevel": "GA",
    "informationurl": "https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/send-in-app-notifications",
    "defaultvalue": "false",
    "environmentvalue": "false",
    "appvalues": {
      "Dataverse Accelerator App": "true",
      "Package Management View": "true",
      "My Custom App": "true"
    }
  },
  ...
]

All properties except uniquename, defaultvalue, environmentvalue and appvalues are ignored. The uniquename property is used to identify the setting to update. The defaultvalue property is the default value for the setting. If provided, it is updated at settingdefinition level. The environmentvalue property is the value for the setting at environment level. If provided, it is updated at organizationsetting level. The appvalues property is a dictionary where the key is the app name and the value is the setting value for that app. It should be provided only for settings that can be overridden at app level.

If you don't provide any of the defaultvalue, environmentvalue, or appvalues properties, or you provide null as a value, no update will be performed for that property. To clear a specific value, pass an empty string instead.

The following are lightweight, valid, sample input JSON files:


[
  {
    "uniquename": "AllowNotificationsEarlyAccess",
    "defaultvalue": "false",
    "environmentvalue": "false",
    "appvalues": {
      "Dataverse Accelerator App": "true",
      "Package Management View": "true",
      "My Custom App": "true"
    }
  }
]


[
  {
    "uniquename": "AllowNotificationsEarlyAccess",
    "environmentvalue": "true"
  }
]


[
  {
    "uniquename": "AllowNotificationsEarlyAccess",
    "appvalues": {
      "My Custom App": "false"
    }
  }
]

As you can see in the above examples, only the uniquename attribute is actually mandatory. Then you have to provide at least one of the other 3 properties. The appvalues dictionary, if provided, must contain at least one app value.

Excel file

The Excel file structure should be EXACTLY the one provided by the pacx settings export command. We higly recommend to:

  • Create a new solution in your Dataverse environment.
  • Add all the settings you need to update to the solution.
  • Export the settings to an Excel file using the pacx settings export command.
  • Modify the settings in the Excel file.
  • Import the settings back using the pacx settings import command.

Arguments

Long Name Short Name Required? Description Default value Valid values
file f Y The file to import the settings from. The file should be in JSON or Excel format. - String