|
JSON Object - Create |
Declaration
<AMJSON JSONSTRING="text" JSONOBJECT="text" />
Description
Creates an Automate JSON Object.
Practical Usage
JSON is primarily used to transmit data between a server and web application, as an alternative to XML. Use this activity to create an Automate JSON Object.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
JSON Object name | Text | Yes | (Empty) | JSONOBJECT="donuts" | The name of the object with which to store JSON decoded data. |
JSON string | Text | No | (Empty) | JSONSTRING="(JSON code text)" | The JSON-formatted string to decode into an object. |
Example
NOTE:
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This sample task creates an Automate JSON Object, and then deletes a value from it.
Copy
<AMJSON JSONOBJECT="donuts" JSONSTRING="{
 "id": "0001",
 "type": "donut",
 "name": "Cake",
 "ppu": 0.55,
 "batters":
 {
 "batter":
 [
 { "id": "1001", "type": "Regular" },
 { "id": "1002", "type": "Chocolate" },
 { "id": "1003", "type": "Blueberry" },
 { "id": "1004", "type": "Devil's Food" }
 ]
 },
 "topping":
 [
 { "id": "5001", "type": "None" },
 { "id": "5002", "type": "Glazed" },
 { "id": "5005", "type": "Sugar" },
 { "id": "5007", "type": "Powdered Sugar" },
 { "id": "5006", "type": "Chocolate with Sprinkles" },
 { "id": "5003", "type": "Chocolate" },
 { "id": "5004", "type": "Maple" }
 ]
}" />
<AMJSON ACTIVITY="delete_field" JSONOBJECT="donuts" PATH="batters.batter[1].type" />