Behavior : JSON

Author:Rex.Rainbow

Download

Properties

Initial data

  • Set initial data. ex:"{"a":10,"b":{"c":"d"}}".

Indent

  • Indent for pretty print. Set (-1) to disable this feature.

Actions

Array

Action:Shuffle

  • Shuffle items in array.
    • Key string ( string ) : The key string of the hash table value to set.

Action:Sort

  • Sort items in array.
    • Entry ( string ) : The entry key string of the hash table.
    • Key ( string ) : The key string for sorting.
    • Sort ( Combo ) : Sort method.
      • Options : ["descending","ascending","logical descending","logical ascending"]

Array - Insert

Action:Insert JSON

  • Insert JSON into array.
    • Key string ( string ) : The key string of the hash table value to set.
    • JSON ( string ) : JSON string.
    • Index ( number ) : Index of this array to insert.

Action:Insert value

  • Insert value into array.
    • Key string ( string ) : The key string of the hash table value to set.
    • Value ( number or string ) : The value to push in the hash table.
    • Index ( number ) : Index of this array to insert.

Array - Push

Action:Push JSON

  • Push JSON into array.
    • Key string ( string ) : The key string of the hash table value to set.
    • JSON ( string ) : JSON string.

Action:Push value

  • Push value into array.
    • Key string ( string ) : The key string of the hash table value to set.
    • Value ( number or string ) : The value to push in the hash table.

Hash table

Action:Clean all

  • {my} clean table.

Indent

Action:Set indent

  • Set indent for pretty print. Set (-1) to disable this feature.
    • Value ( number or string ) : The value to push in the hash table.

Keys

Action:Pick keys

  • Pick keys into an array.
    • Key string ( string ) : The key string of the hash table.
    • Array ( object ) : Array instance to put result.

Load

Action:Load from JSON

  • Load content from JSON string.
    • JSON string ( string ) : JSON string.

Merge

Action:Merge

  • Merge hash table with other hash table.
    • Hash table B ( object ) : Hash table instance to merge.
    • Mode ( Combo ) : Merge mode.
      • Options : ["Overwrite from hash B","Merge new keys from hash table B","Clean then copy from hash table B"]

Remove

Action:Remove key

  • Remove key.
    • Key string ( string ) : The key string of the hash table value to remove.

Value

Action:Set value

  • Set value by a key string.
    • Key string ( string ) : The key string of the hash table value to set.
    • Value ( number or string ) : The value to store in the hash table.

Action:Set JSON

  • Set JSON by a key string.
    • Key string ( string ) : The key string of the hash table value to set.
    • JSON ( string ) : JSON string.

Action:Add to

  • Add to the value of key.
    • Key string ( string ) : The key string of the hash table value to add.
    • Value ( number or string ) : The value to store in the hash table.

Expressions

Array

Expression:Pop

  • Pop from array.
    • Key ( string ) : The key of the hash to get.

For each

Expression:CurKey

  • Get the current key in a For Each loop.

Expression:CurValue

  • Get the current value in a For Each loop. Add 2nd parameter to return sub-item by keys. Add 3rd parameter to return default value when got invalid value.

Expression:Loopindex

  • Get loop index in a for each loop.

Items

Expression:ItemCnt

  • Get item count. 0 means the item is number or string type, (-1) means the item does not exist.
    • Key ( string ) : The key of the hash to get.

Expression:Keys2ItemCnt

  • Get item count by keys, each parameter is a key. 0 means the item is number or string type, (-1) means the item does not exist.
    • Key ( number or string ) : The key of the hash to get.

JSON

Expression:ToString

  • Create a hash table and transfer it to JSON string. If there has no parameter, transfer current hash table to JSON string.

Expression:AsJSON

  • Get content as JSON string.

Key

Expression:RandomKeyAt

  • Get random key in a table. Add 2nd parameter to return default value when got invalid value.
    • Key ( string ) : The key of the hash to get.

Value

Expression:At

  • Get value from the hash by key string, return JSON string if the item is an object. Add 2nd parameter to return default value when got invalid value.
    • Key ( string ) : The key string of the hash to get.

Expression:AtKeys

  • Get value from the hash by keys, each parameter is a key.
    • Key ( number or string ) : The key of the hash to get.

Conditions

Entry

Condition:Is empty

  • Return true if an entry is empty i.e. has no key.
    • Key string ( string ) : The key string of the hash table.

For Each

Condition:For each key

  • Repeat the event for each item in key.
    • Key string ( string ) : The key string of the hash table.

Key

Condition:Key exists

  • Return true if a key exists in hash table.
    • Key string ( string ) : The key string of the hash table.