I have to create Dynamic UI meaning based on the API JSON response received.
I will be receiving the input type like check box or input and all the other attributes in JSON response, using that can i create the component and create dynamic UI?
Discussion posts and replies are publicly visible
You can but this will not be very robust or as dynamic as you visualize it to be. Also, every component in Appian is mapped with a variable where it will store the response/interaction. That will be done in a dictionary instead of a variable now. I'll attach a code sample below in the next comment.
If you HAVE to do that, then yes, it can be done. Just create a UI component for each UI element in your JSON.
But, in my experience this is not a good way to make use of Appian and will lead to serious issues and major development effort later on.
Thank you for the update.Kindly share the sample code. And one more doubt when we the receive the UI component as API response.
Will we be able to create interface with Appian available components or it is feasible to create interface using custom component received via API response?
And also can you share any document or link to understand and implement the same.
I do not have sample code I could share, but the pattern is to use the choose() function to check for the UI components you need and then for each, use the Appian UI components to build them. Then, run this expression in a foreach() to create that UI.
This is not a simple endeavour that includes some edge cases of what can be done with Appian.
And when you start thinking about doing this using custom components, which is feasible, I have to ask, why exactly do you want to use Appian?
Thank you for the clarification.
I was asking about custom components because if there is a scenario that there is a mix of Appian components and also custom component to be presented in dynamic UI.
Then if that will be feasible was the motive behind asking about custom component feasibility.
I understand. Can you elaborate a bit on your overall use case? Why do you need to build dynamic UIs in Appian?
My use case will be like say Client Onboarding Application in which it has multiple tabs like Personal Details, Employment Details, etc and all this interface will be built in using Appian layout and components.
There will be one tab Like Risk Assessment, when the user clicks this tab it will call an API and we will get the components in API response and based on the response the UI components and page should be available dynamically to the user.
Will you be storing the risk assessment data in your database or will you be sending it back to the API?
We will be storing the data in our database and also sending the response to the API so that we can fetch the risk score again in API based on the answers we submit