Skip to content

JSON Information

Info

New in Atfinity 17.

Definition

JSON is an information type that holds a whole JSON object or array in a single field, so data that belongs together stays together instead of being split across separate fields. A reply from an API, a nested set of options or any values a rule builds itself can be kept as they are.

Reading and writing it in a rule

The value reads as a dictionary or a list, whichever was stored, so the operators of those types apply to it:

c is Company
c.sanctions_reply['hits'][0]['score'] > 0.9

Assign a dictionary, a list, or a string of valid JSON. Text coming back from an API is parsed with STRING_TO_JSON:

c is Company
---
c.sanctions_reply := STRING_TO_JSON(c.raw_api_reply)

Changing the type

Only Text (multiple lines) and Rich Text can be changed to JSON, and JSON can be changed back to either. Coming from Rich Text the formatting is dropped and the plain text has to be valid JSON.