I have a repeater with 5 input blocks
when I add items to the repeater, based on a value in one of the fields, I want to set the visibility of the input block to false
fields A B C D E
when field A = “off” set the visibility of field D and E to false
since the repeater replicates the blocks for each row, I’m not sure how to access an individual input block’s visibility settings.
Based on your requirements you could create a visibility map(object) that will contain field names and boolean values to decide if field should be shown.
For example map:
Visibility logic for your input fields could look like:
Or you could extend your repeated items with some property that you could use in the Visibility Logic handler to decide if it should be shown.
Thanks for the response! Using your example I came up with this
I thought I’d add this incase it helps someone else learning about scope (data models )
two take aways from this.
within the data row, the databinding is the property’s of each block which is how you can reference them to get their values.
in hindsight this is obvious but for me it didn’t click until I used a print block on the repeater data item and saw the field names and their values
The second thing is the context block list at the top of the logic page is a horizontal scroll bar. which I did not see at all and would not have looked for until your post showing the “data repeater item”
the scroll bar is really hard to see, just a slightly darker color. After I found that and scrolled all the way to the right did I see the repeater context block
Thanks again for your help!