We have a few hundred products. Each product has different configuration fields (with different labels or data types). Depending on which product is selected by the user, the interface displays various fields for the user to fill out. Does Appian provide a way to render such dynamic interface based on the configuration fields defined in a database table by product? I am trying not to write an interface for each product. Any comments and suggestions are appreciated.
Discussion posts and replies are publicly visible
Appian has tools to help speed up development. If your products are in a database then you can quickly create Appian data types (CDTs) https://docs.appian.com/suite/help/20.2/Mapping_CDTs_to_Pre-defined_Database_Tables.html#create
You can then quickly create interfaces from these data types. https://docs.appian.com/suite/help/19.2/interface_object.html#create-from-data-type
We have a few hundred products. I do not want to create a few hundred CDTs and Interfaces for these products. Is it possible to dynamically create Appian interfaces from a DB table on the fly if the DB table stores field definitions for each product?
This sounds like it can be done, assuming you have sufficient metadata in your DB fields to describe what SAIL fields Appian should render, (and you can get that metadata entered easily). Though, for the part where you will store data about each product from those fields back into Appian, you would probably need to have a farily all-encompassing data structure to generically handle all product types in one (or at least a very few) CDT types. Also this is sort of in the "Extended functionality" area of Appian so a lot of it will be up to you to figure out and then build.
Hi Cindy - as Mike alludes to, having a database model that will allow you to capture the relevant metadata about each field for each product would be the way to go, assuming you can map each to a small number of generic datatypes that can be used to write the Product instances back to a product database. A quick scrawl on some scrap paper (my go-to-design method!) suggests something like:
Whatever is "common" between Products will go in the 'Product Table', the Product specific attributes will be listed in the 'Attribute' table and each attribute will have an attribute 'Type' (e.g. Text, Integer, Boolean, etc.). AT run-time your application will fetch all of the Attributes for the selected Product, each with a Type, and the 'Type' used to render the relevant interface component. Yes, there's lots of detail to be worked through but this should get you going. (NOTE: you'll also need a means by which the content of these tables can be managed - new Products defined, existing Products maintained etc.)
Thx for sharing the design idea. I agree there are a lot of details to iron out. It may not be easy to implement.
In general, as long as you have the necessary information for each data structure and field, then you can have fully dynamic interfaces. I already did similar things in the past.
I can think of one solution for your problem, but it wont be super easy.
1) Create a table that has defined all the properties of each product (labels and so on)
2) Create and expression rule that provides you the structure that you need i.e getProductStructure(product:"ABC") that returns something of the type {name:Col1, value:2.3, type:decimal}
3) Create an dynamic interface that goes on loop with if conditions that loops all the element of the array provided from getProductStructure. So kind of if(local!structure = "decimal", a!float...(), {if(local!structure = "Text, a!textField(..),{})}) and so on
4) Create a script based on Appian with a start form that receives an XML and reads the XDS files of your CDTs, and writes on the a new table / update the table with the product name CDT and its fields.You will need here quite a development to make it work.
The step 4 can be a loop for each of the files. You can easily have all the XDS by making a patch of your application, extracting it and checking the zip file.
Good luck!
Best,
Manuel
Stefan, can you give some more idea on how you implemented this (High level). We have similar requirements and we do have metadata of our data structures as well.
This is pretty simple. Load meta data, loop (foreach) on the fields and put a choose() inside to call fields depending on data type.
If you need editable fields, make sure to use a syntax like
saveInto: local!data[local!fieldname]