Last active
May 27, 2021 15:13
-
-
Save avwilks/fa6a6a96c89a6fa535660b4112af1236 to your computer and use it in GitHub Desktop.
Conditional Fields Example Document
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"field1":{ | |
"field1a":{ | |
"when":"(a) => a.includes('USA')" | |
}, | |
"field1b":{ | |
"when":"(a) => a.includes('Mexico')" | |
}, | |
"field1c":{ | |
"when":"(a) => a.includes('Canada')", | |
"field1ca": { | |
"when": "(a) => a.includes('Ontario')", | |
"field1caa": { | |
"when": "(a) => a.length > 0" | |
} | |
} | |
} | |
}, | |
"field2":{ | |
"field2a": { | |
"when":"(a) => a === 'Yes'" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a quick example of how I imagine node traversal working with this: https://codesandbox.io/s/staging-darkness-15r62?file=/src/App.js