Conditional Expressions / Visibility - Hide/Show Fields based on Value of a Choice Field
AnsweredGreetings,
I am trying to understand the logic concerning conditionally showing or hiding (visibility) Fields, depending on the Value of another field. None of the documentation seems to touch on this, and any related forum posts are 6 years old, and don't seem to function any longer.
In the below example, we have a: Choice-type field (Rework), with options of 'Yes' & 'No'. The goal is to display certain Fields if the Value of the Choice field is 'Yes', and to keep them hidden if the Value is 'No', which is default.
If Rework = No, I want all 4 related Rework fields to be hidden.
If Rework = Yes, I want all 4 related Rework fields to be rendered.
So for example, if Rework=Yes, what would be the formula to show 'Description of Rework" field? [Internal Name: ReworkDescription]
In the SharePoint, I am currently able to use the following formula to hide fields related to Rework: =if([$Rework] == 'Yes', 'true', 'false')
Screenshot of original SP form:
Current Skybow configuration:
A few more related questions:
1. Are there nuances within Skybow concerning the Internal vs Display names of columns?
2. When you hover over a field, and select 'Configure Expressions'... Can you simply type a formula into the Visible field? Or do you need to click { } next to it, and somehow use the GUI to make selections?
If you do have to use the GUI, is there any documentation that supports the current version of Modern Forms?
I absolutely appreciate any help!
-Taylor
-
Official comment
Dear Taylor Ramsey,
thanks for reaching out to us.
the skybow Expression language is based on plain JavaScript extended with our placeholders. To access field you can always use double brackets and the internal field name inside like this: [[internalfieldname]]
The Expression Builder has 3 different expression types Template, Assignment and Function. Those are described on our introduction page here: https://my.skybow.com/hc/en-us/articles/4413484697618-Expression-Builder-introduction
If you want to type directly into the configuration textbox without opening the Expression Builder you can do that, but you have to take care about the first character which defines the expression type; = is used for an Assignment, { } are used for a function and if there is none of these it is evaluated as template text and only the placeholders are replaced.
Your example is as easy as this: =[[Rework]]=="Yes"
This will return true if rework is yes and it will show the column otherwise not. You could also put the 4 columns in a separate row or tab and add the visible expression just once on that control instead on every column the same.
Please also find an interactive demo on the field expressions here: https://bit.ly/3Gt4zND
Kind regards
skybow Support
-
I absolutely appreciate the quick and thorough response! I am absolutely enthralled with yall's product at this point!
1 -
Hi Taylor Ramsey, thanks for this great feedback. Happy to hear that! 🤗
You are always welcome to get back to us if you have any other questions.
Kind regards
Matthias
0
Please sign in to leave a comment.
Comments
3 comments