json-tool-kit
Service icon

JSON Tool Kit

Stable version 1.1.2 (Compatible with OutSystems 11)
Uploaded
 on 12 Jul
 by 
4.7
 (3 ratings)
json-tool-kit

JSON Tool Kit

Documentation
1.1.2

JSONtoXML

First the JSON passed as source needs always a root element (in the below example there's a 'root' property, could be with any other name):

  • Result


XMLtoJSON

This action converts a XML string to JSON.

  • Result


SelectToken

This action returns the selected token.

  • Result


SelectTokens

This action returns the selected tokens.

  • Result


AddProperty

This action load a JSON, and then you can add a property, returning the new JSON with the new property included.

If IsJSONValue is true, the PropertyValueToAdd it is considered as a JSON string.

If IsJSONArray is true and IsJSONValue is false, the PropertyValueToAdd it is considered as a JSON array string.

If IsJSONValue and IsJSONArray are both false, the PropertyItemToAddToArray is considered as single string.

  1. If the new property is a JSON array
  2. If the new property is JSON string
  3. If the property is a text literal



AddArrayItem

This action load a JSON, and then you can add a array item, returning the new JSON with the new array item.

If IsJSONValue is true, the PropertyItemToAddToArray is considered as a JSON string. Otherwise, it is considered as single string.

  1. If the new property is JSON string
  2. If the property is a text literal


PropertyValueToUpper

Transforms a property value to upper case.

  • Result



RemoveProperty

This action load a JSON, and then you can remove a property, returning the new JSON without that property.

  • Result



More info about, and how to use it:

- https://www.newtonsoft.com/json/help/html/ModifyJson.htm

- https://www.newtonsoft.com/json/help/html/QueryJson.htm



1.1.1


  • First the JSON passed as source needs always a root element (in the below example there's a 'root' property, could be with any other name):


"{
  
  'root': {
    'person': [
      {
        '@id': '1',
        'name': 'Alan',
        'url': 'http://www.google.com'
      },
      {
        '@id': '2',
        'name': 'Louis',
        'url': 'http://www.yahoo.com'
      }
    ]
  }
}"


  • Example of the action AddArrayItem (This action load a JSON, and then you can add a array item. Returns the new JSON with the new array item):


   a) JSON source input parameter: 

"{
  'root': {
    'title': 'Star Wars',
    'link': 'http://www.starwars.com',
    'description': 'Star Wars blog.',
    'obsolete': 'Obsolete value',
    'item': []
  }
}"

b) The other inputs parameters:

c) The result:



  • Example of the action AddProperty (This action load a JSON, and then you can add a property. Returns the new JSON with the new property included.):


a) JSON source input parameter: 

"{
  
  'root': {
    'person': [
      {
        '@id': '1',
        'name': 'Alan',
        'url': 'http://www.google.com'
      },
      {
        '@id': '2',
        'name': 'Louis',
        'url': 'http://www.yahoo.com'
      }
    ]
  }
}"


b) The other inputs parameters:



c) The result:



  • Example of the action JSONtoXML(Converts JSON into XML):


a) JSON source input parameter: 




b) The other inputs parameters:




c) The result:


  • Example of the action PropertyValueToUpper(Transforms a property value to upper case.)


a) JSON source input parameter: 



b) The other inputs parameters:


c) The result:



  • Example of the action RemoveProperty(This action load a JSON, and then you can remove a property. Returns the new JSON without that property):


a) JSON source input parameter: 



b) The other inputs parameters:



c) The result:



  • Example of the action SelectToken(This action returns the selected token.)


a) JSON source input parameter: 



b) The other inputs parameters:



c) The result:





  • Example of the action SelectTokens(This action returns the selected tokens.):


a) JSON source input parameter: 



b) The other inputs parameters:




c) The result:




  • Example of the action XMLtoJSON(This action returns the selected tokens.):


a) JSON source input parameter: 

b) The other inputs parameters:





c) The result:




More info about, and how to use it:

- https://www.newtonsoft.com/json/help/html/ModifyJson.htm

- https://www.newtonsoft.com/json/help/html/QueryJson.htm