Skip to main content
April 21, 2023
Question

web API integration

  • April 21, 2023
  • 8 replies
  • 0 views

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?

    8 replies

    gopalk2865
    Participating Frequently
    April 22, 2023

    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?

    April 24, 2023

    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?

    stefanhelzle0001
    Brainy
    April 24, 2023

    You can just cast any data structure to a CDT. Appian will then match the fields by name.

    stefanhelzle0001
    Brainy
    April 22, 2023

    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.

    harshitb6843
    April 22, 2023

    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. 

    abhayd3663
    April 24, 2023

    Create CDT with the exact same structure as the API output with nesting and the casting should work fine.