Hide interface field if it has a null value

If a variable does not have a value save into it how do you hide it in the interface? 

This was my attempt at it using the showWhen variable: 

a!dateField(
label: "Tier 2 Findings",
labelPosition: "ABOVE",
value: ri!svcRequest.tier_two_date,
saveInto: {},
showWhen: if (ri!svcRequest.tier_two_date, true, false) ,
readOnly: true,
validations: {}
),

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    I hope You found a way to conditionally show a UI component.

    Incase if you don't have "showWhen" parameter for a certain component, then can you wrap the entire UI component which you want to hide conditionally in an if() function.

    if(

    a!isNullOrEmpty(ri!svcRequest.tier_two_date),

    {},

    a!dateField(
    label: "Tier 2 Findings",
    labelPosition: "ABOVE",
    value: ri!svcRequest.tier_two_date,
    saveInto: {},
    readOnly: true,
    validations: {}
    )

    )


    Assume that the a!dateField has no "showWhen" parameter.

Reply
  • 0
    Certified Senior Developer

    I hope You found a way to conditionally show a UI component.

    Incase if you don't have "showWhen" parameter for a certain component, then can you wrap the entire UI component which you want to hide conditionally in an if() function.

    if(

    a!isNullOrEmpty(ri!svcRequest.tier_two_date),

    {},

    a!dateField(
    label: "Tier 2 Findings",
    labelPosition: "ABOVE",
    value: ri!svcRequest.tier_two_date,
    saveInto: {},
    readOnly: true,
    validations: {}
    )

    )


    Assume that the a!dateField has no "showWhen" parameter.

Children
No Data