User Tools

Site Tools


transformations:extractjsonproperties

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

transformations:extractjsonproperties [2022/10/07 22:16] – created craigttransformations:extractjsonproperties [2022/10/07 22:18] (current) – removed craigt
Line 1: Line 1:
-{{ transformations:ExtractJsonAction.png}} 
-======EXTRACT JSON PROPERTIES====== 
-Category: Transform / Web \\ 
  
-\\  
-=====Description===== 
-This action creates new columns with values from selected JSON [[https://en.wikipedia.org/wiki/JSON|JSON]] properties contained within a single-cell text string typically received from an API call. 
- 
-\\  
-=====Action settings===== 
-^Setting ^Description ^ 
-|Source JSON|Select the column that contains the JSON text.| 
-|New column names|Choose the mode for creating and naming columns from the selected JSON object.  Options:  //Property name//\\ or //Explicit//. See below for details.| 
-|JSON path|Select the specific JSON path(s) to extract into the defined columns.  See below for details.| 
-|Position|Choose where the new columns will appear in the table.  Options:  //Rightmost//, //Leftmost//, or //After column// (and\\ select the column the new columns will appear after).| 
-|If JSON path not found|Choose how EasyMorph will respond to situations when the selected JSON path is not found in the dataset.\\  Options:  //Fail// (and halt the workflow) or //Return error// (generate an error and continue the workflow).| 
- 
-\\ 
-==== New column names "Property name" settings ==== 
-This mode will create a new column with the same name as the path selected in the "JSON path" setting. 
- 
-\\ 
-==== New column names "Explicit" settings ==== 
-In this mode, individual columns are created, and manually named, based on the selected JSON paths. 
- 
- 
-\\ \\  
-=====Examples===== 
-**Source JSON:**  Column name is "Response-Body" (all text contained within a single cell).\\ 
-<code> 
-{"Employees":[{"name":"Doug", "id":7, "dept":"Accounting"},{"name":"Sue","id":2, "dept":"HR"},{"name":"Mark", 
- "id":5, "dept":"Maintenance"},{"name":"Tamara", "id":1, "dept":"Administration"}]} 
-</code> 
- 
-\\  
-**Action parameters:** 
-> Source JSON is "Response-Body" 
-> New column names is "Property name" 
-> JSON path is "Employees" 
-\\  
- 
-**Result:**  (Contained within a single cell.) 
-<code> 
-[ 
-  { 
-    "name": "Doug", 
-    "id": 7, 
-    "dept": "Accounting" 
-  }, 
-  { 
-    "name": "Sue", 
-    "id": 2, 
-    "dept": "HR" 
-  }, 
-  { 
-    "name": "Mark", 
-    "id": 5, 
-    "dept": "Maintenance" 
-  }, 
-  { 
-    "name": "Tamara", 
-    "id": 1, 
-    "dept": "Administration" 
-  } 
-] 
-</code> 
- 
-\\  
-===== See also ===== 
-  * [[transformations:parsejson|Parse JSON]] 
-  * [[transformations:extractjson|Extract JSON properties]] 
-  * [[transformations:splitjson|Split JSON array]] 
-  * [[transformations:modifyjson|Modify JSON]] 
-  * [[syntax:functions:isjson|Functions:  IsJson()]] 
-  * [[https://community.easymorph.com/t/example-constructing-json/1279/5|Community example: Constructing JSON]] 

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki