Skip to main content
June 5, 2021
Question

Conditionally displaying data in grid

  • June 5, 2021
  • 5 replies
  • 1 view

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!!

    5 replies

    stefanhelzle0001
    Brainy
    June 5, 2021

    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.

    mikes0011
    Brainy
    June 5, 2021

    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.

    The Expression Guru
    June 7, 2021

    Hi, thank you. Can you please give me an example on how to do that? 

    stefanhelzle0001
    Brainy
    June 7, 2021

    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?