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!
@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.
@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...
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.
@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!?
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.