Hi,
I have an interface with a section layout which displays a read-only grid using a!gridField_19r1(). The data is fetched from a DB view using a query rule and displayed in the grid columns.
My requirement is to conditionally display the data in one of the columns called Proposal Type. There is a boolean column named IsEarlyRenewal which stores true or false and for every entry in the view, I need to conditionally display if(IsEarlyRenewal = true, "Early Renewal', whatever the original value of the ProposalType column) .
So, example:
id= 12345, IsEarlyRenewal = false, ProposalType = Modification -> ProposalType returned as Modification
id= 56789, IsEarlyRenewal = true, ProposalType=Modifiction => Proposal Type returned as Early Renewal
Both the Proposal Type and IsEarlyRenewal are columns in the view and can be fetched on the interface.
TIA!!
Discussion posts and replies are publicly visible
https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/
Would you please explain what the question is, what did you try and what failed. Code snippets, screen shots.
I strongly recommend you to upgrade this grid to use the 19.2+ version of a!gridField() - this upgraded version makes it substantially easier to do row-by-row conditionality like what you're saying you need. In the deprecated version you're using, it requires looping over the data subset and doing your conditionality within the loops, which is doable but cumbersome and far more easily prone to errors.
Hi, thank you. Can you please give me an example on how to do that?
Which version of Appian? Did you check the docs?
https://docs.appian.com/suite/help/21.2/SAIL_Recipes.html
Did you already try/test something? What went wrong?
You would need to remove the "_19r1" from the end of the a!gridField rule, then change some of the components. The columns would need to be changed to use a!gridColumn() instead of a!gridTextColumn(), and these would get their data by directly referencing fv!row. I recommend first making a copy of the code for the original grid and trying to changeover the copy.