Hi All
I want to create a CDT and an interface by passing JSON script
Or even if I can pass json and create an input field in interface
eg.[{"fieldname" : "name", "datatype": "varchar"}]
this should create an input for name and datatype varchar.
I am at beginner level in appian...please guide how can I proceed.
Discussion posts and replies are publicly visible
What is the purpose?
Creating a CDT is a manual process and an interface can be created based on a CDT in the interface designer.
In general, try to follow the trainings in academy and tutorials in documentation to understand how to implement things in Appian.
docs.appian.com/.../Tutorials.html
I assume you want to create dynamic ui. Below links might be useful!
https://community.appian.com/discussions/f/user-interface/17788/dynamically-render-ui-components-text-date-and-paragraphfield-from-database-table
https://community.appian.com/discussions/f/user-interface/18241/designing-dynamic-forms
https://community.appian.com/discussions/f/user-interface/10883/array-looping-function-for-dynamic-layout
Check out https://docs.appian.com/suite/help/21.2/fnc_system_a_fromjson.html
and https://docs.appian.com/suite/help/21.2/fnc_system_a_tojson.html to see if these answer your question.
In short, you can convert from Appian to JSON and back, but it won't be a CDT immediately. If the CDT structure already exists in Appian (you built the structure yourself), then you can cast the Dictionary output by the fromJSON() function into an INSTANCE of that CDT. So your users will be able to convert JSONs into your CDT automatically.
You can run it once and use that as a template for the construction of your Data Type (which would be like blueprints for all future CDTs of that type). Once you have a Data Type you can have Appian automatically create an interface based on it. You'll probably want to tweak it a little. Then your code could receive JSONs and display the values in the interface immediately. Your users could even finish the form and send JSONs back out to whatever service you're using.
thanks for your response
Hi,
I am having json script through which i want to create an interface as a UI and display input fields such as textbox, integerfields based on values passed in json u can say it is a dynamic form creaion but with JSON
I don't think Appian has built that yet. The CDT creation runs on XSD, which is XML format, under the hood. Or a WSDL, which is also XML format.
It's possible that Appian could invent CDT from JSON as a new method of CDT creation. It might be a little difficult to ensure that Primary Key and Foreign key and other constraints were met, but possible.
So unfortunately your choices are create WSDL based on JSON and import, or create CDT manually in Appian based on JSON, at least for now.
I really would be interested in that use case.
Me to. It is usefull for example to create CDT that can be used with an integration (Rest API)