Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Up Program - Build A Canvas App
Answered

Query regarding making fields visible

(1) ShareShare
ReportReport
Posted on by 121
I am creating a canvas app to go alongside my model driven app. It's all very new to me so I may have some silly questions. On this "add new contact" form, I would like to make the last 2 fields visible, only if the answer to field number 1 includes the word "antenatal" in the answer. Field number 1 is a choice column and is DatacardValue4. It has 9 different options in the dropdown/combobox, two of which include the word "antenatal".  I'd be really grateful if someone could tell me the formula that I need to put in the Visible option please! 

Categories:
  • stampcoin Profile Picture
    2,179 on at
    Query regarding making fields visible
    Ok, Please mark it as answered.
    Regarding the fields visibility, please consider using DisplayMode.
    sometimes, it will give the end user good experience.
    for example 
    If(
     "contains" in Lower(DataCardValue4.Selected.Value), DisplayMode.Disabled,DisplayMode.Edit
    )
  • CD-28031715-0 Profile Picture
    121 on at
    Query regarding making fields visible
    @stampcoin Thanks again. I've given it another go and it still makes the fields invisible all the time. But not to worry, it's fine that they just stay where they are. It's more important that I got the first part working, so thanks so much for that. 
  • Verified answer
    stampcoin Profile Picture
    2,179 on at
    Query regarding making fields visible
    It should work, or I misunderstood ?
     
    1. For 'Baby Date of Birth', Visible =
    If(
        "antenatal" in Lower(DatacardValue4.Selected.Value),
        false,
        true
    )
    2. For 'Baby Age Range', Visible=
    If(
        "antenatal" in Lower(DatacardValue4.Selected.Value),
        false,
        true
    )
    Both controls reply on 'DatacardValue4.Selected.Value', if 'antenatal' selected, both will be invisible.
  • CD-28031715-0 Profile Picture
    121 on at
    Query regarding making fields visible
    @stampcoin, I'm afraid that hasn't worked, it's hidden the field for all options. I can't seem to get the tag to work, so I'm not sure if you'll see my reply... 
  • stampcoin Profile Picture
    2,179 on at
    Query regarding making fields visible
    I see. 
    Try to set the Visible property for the Baby Date of Birth and Baby Age Range fields to
    If(
        "antenatal" in Lower(DatacardValue4.Selected.Value),
        false,
        true
    ).
     
    This logic ensures:
    Antenatal (before birth):
        Baby Due Date visible
        Baby Date of Birth and Baby Age Range hidden
    Not Antenatal (after birth):
        Baby Due Date hidden
        Baby Date of Birth and Baby Age Range visible.
    😊
     
  • CD-28031715-0 Profile Picture
    121 on at
    Query regarding making fields visible
    @stampcoin I mean that I would want to hide them, ie the baby hasn't been born so we don't know his age, instead we know his due date.
  • stampcoin Profile Picture
    2,179 on at
    Query regarding making fields visible
    Not quite sure what your meaning is... You want to remove those or you want to hide them ?
     
  • CD-28031715-0 Profile Picture
    121 on at
    Query regarding making fields visible
    @stampcoin That worked! Thanks so much! I'm now thinking that I could also remove the Baby Date of birth and Baby age range too, if antenatal is chosen in DatacardValue4... or is that asking too much!? 
  • Suggested answer
    stampcoin Profile Picture
    2,179 on at
    Query regarding making fields visible
    For your Visible property =
    If(
        "antenatal" in Lower(DatacardValue4.Selected.Value),
        true,
        false
    )
     
    DatacardValue4.Selected.Value refers to the selected value of your choice dropdown.
    Lower() converts the text to lowercase, ensuring the formula is case-insensitive.
    "antenatal" in checks if the word "antenatal" exists in the selected choice.
    Apply this formula to the Visible property of each of the last two fields individually.
    Make sure DatacardValue4 correctly references your first field; adjust if your naming is different.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Leaderboard >

Featured topics