Note
This repository is no longer actively maintained.
We appreciate all the contributions and support from the community over the years. For those interested in continuing the development, feel free to fork the repository.
If you have any questions or need assistance, please refer to the existing documentation and issues. Thank you for your understanding.
Quickly create entities, attributes, keys and relationships in Dataverse from a JSON.
Before you can run the script, you will need to setup the connection between it and your Dataverse instance:
- Create
./JSON2Dataverse/app.configfile - Add
connectionStringwith the namedynamicsto the file. Or copy the example one below to get started
Note
Replace:
YOUR_ENVIRONMENT_URL with your Dataverse enironment URL and,
YOUR_AZURE_APPID with the Microsoft Entra SSO App ID
<?xml version='1.0' encoding='utf-8'?>
<configuration>
<connectionStrings>
<add name="dynamics"
providerName="Microsoft.Xrm.Sdk.Client"
connectionString="AuthType = OAuth;
Url = YOUR_ENVIRONMENT_URL;
AppId = YOUR_AZURE_APPID;
RedirectUri = http://localhost:64636;
LoginPrompt = Auto;
RequireNewInstance = True" />
</connectionStrings>
</configuration>The JSON file is used as a instructionset for the script.
[
{
"Name": "ENTITY_NAME",
// Optional
// Can be ATTRIBUTE_DATATYPE: "string", "int", "datetime"
"PrimaryKey": "ATTRIBUTE_NAME",
"Members": {
// First member is primary attribute
// Can be ATTRIBUTE_DATATYPE: "string"
"ATTRIBUTE_NAME": "ATTRIBUTE_DATATYPE",
"ATTRIBUTE_NAME": "ATTRIBUTE_DATATYPE"
},
// Optional
"ManyToOne": {
"RELATIONSHIPNAME": "ENTITY_NAME_RELATING_TO"
},
// Optional
"ManyToMany": {
"RELATIONSHIPNAME": "ENTITY_NAME_RELATING_TO"
}
}
]| ATTRIBUTE_DATATYPE | Dataverse type |
|---|---|
| enum | Single line text |
| string | Single line text |
| boolean | Yes/No |
| datetime | Date and time |
| integer | Whole number |
| long | Whole number (Big) |
| decimal | Decimal |
| binary | File |
Once you have the script setup and the JSON file created, you can run the script to build the Dataverse entities. This will first create the entities, attributes and keys; then create the relationships (Many-to-one and then Many-to-many).