CreateSchema
Generates a schema file that defines the structure of a JSON table, including field names and data types.
CreateSchema
Creates a local schema file (.rsd) from an existing table or view in the data model.
The schema file is created in the directory set in the Location connection property when this procedure is executed. You can edit the file to include or exclude columns, rename columns, or adjust column datatypes.
The add-in checks the Location to determine if the names of any .rsd files match a table or view in the data model. If there is a duplicate, the schema file will take precedence over the default instance of this table in the data model. If a schema file is present in Location that does not match an existing table or view, a new table or view entry is added to the data model of the add-in.
Input
| Name | Type | Description |
| TableName | String | Specifies the name of the JSON table for which the schema file will be created. |
| URI | String | Specifies the Uniform Resource Identifier (URI) of the JSON resource from which the schema will be generated. |
| JSONFormat | String | Defines the format of the JSON document. Depending on how the data is structured within the file, valid values can be JSON, JSONRows, or LDJSON. |
| JSONPath | String | Specifies the JSONPath expression pointing to a repeating element at the same hierarchy level in the JSON document. This path determines how the document is split into multiple rows. |
| WriteToFile | String | Indicates whether the generated schema should be written directly to a file. The default value is 'true'. Set to 'false' to write the schema to FileStream or FileData instead. |
| FileName | String | Specifies the full name and path of the schema file to be generated. |
| Method | String | Defines the HTTP method used to retrieve the JSON data, such as GET or POST.
The default value is GET. |
| ContentType | String | Specifies the Content-Type header included in the request, particularly when sending data through the PostData field. |
| Data | String | When applicable, contains the data payload to be sent in the body of the HTTP request. |
Result Set Columns
| Name | Type | Description |
| Result | String | Indicates whether the operation was successful or failed. |
| FileData | String | Returns the generated schema content encoded in base64. This output is provided only when WriteToFile is set to 'false' and FileStream is not used. |