Passing JSON format into datastore

I'm wanting to pass json format file into a CDT and ultimately into data store using the Write to Datastore Smart Service.

What's the function I need to write as per below so that I can make this work ? Can't work out how to get from json into Dictionary or List format which seems to be required ?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Currently working on configuring the "Load JSON Document To Database" plugin, and I'm seeking some clarification on specific fields. let's say my format for json is 

    {
        "validation.required": "Oops! This field is required.",
        "signup_button": "Sign up now",
        "welcome_header": "Welcome to Lokalise!"
    }

    and the CDT "FJI_jsonData" holds the following fields id, Key(text), Value(Text) and the document is stored in the pv!jsonData

    Fields:
    1. JSON Document (Document): [Should there be a appropriate expression to parse the json or just the document?]
    2. JSON Path (Text)
    3. JSON Fields Match (Any Type): 
    4. JSON key/Column Name mapping (Any Type)
    5. Columns To Process (Text) 
    6. Table Audit fields (Any Type)
    7. Unique Index Columns (Text)
  • 0
    Certified Lead Developer
    in reply to Mathieu Drouin

    could you please help us to configure that plugin if you use, there is no documentation so we tried to understand by looking into code but we observed parameters are different in SS config and the code.

  • 0
    Certified Associate Developer
    in reply to Anna P
    The following node configuration may be helpful:
    JSON Document -> Document that contains JSON data
    JSON Path (Text) -> JSON fields (ex. ={"name", "createdBy"})
    JSON key/Column Name mapping (Any Type) -> JSON and database table mapping (ex. {name: "Name", createdBy: "CREATED_BY"})
     Let me know if you need any other details.
  • 0
    Certified Senior Developer
    in reply to Yogi Patel

    Hi  

    {
    	"date":"2024-06-18T06:42:25.528Z",
    	"age":12,
    	"name":"test",
    	"test":{
    		"designation":"consultant"
    	}
    }

    My code is kind of this in an array. How to get nested fields and save in DB using Load JSON document to DB