Hi,
I have an API that has an output that looks like below. can anyone suggest to me how to add data to the database without changing any output from the API?
Discussion posts and replies are publicly visible
HI, Convert your api output data into a cdt and then you can write the data into DB easily . Whats the issue you are getting while adding these data into db?
This seems to be a deeply nested self-referencing structure. You will have to analyze the structure and turn it into a data model that you can store in a relational database. Appian is moving towards Records and suggest to not use CDTs for any new developments.
Like others said, you need to convert the output in various CDTs and then save it, if you want to filter and report on this data later. Else, you can just cast this data into a JSON using a!toJson() and just store it as a string value.
Hi Gopal K,
as the data is nested, it shows only the first values and the rest of them are null.
Can you explain how to convert api data into a CDT?
You can just cast any data structure to a CDT. Appian will then match the fields by name.
Can you explain me how to do it ?
Is it done directly from the call integration output and then stored?
I suggest to call that integration inside an expression. Configure the integration object to transform JSON to Appian values. Then, in the expression, add the required logic to transform this into your CDT structures.
Create CDT with the exact same structure as the API output with nesting and the casting should work fine.