I’m trying to realize a survey with JSONForms.
Hi there… sorry for the lame question… json-schema noob here.
I’ve got a string property with an array of enumables as values…
"current_bills": {
"title": "Attuali Utenze",
"type": "array",
"items": {
"type": "string",
"enum": ["Luce", "Gas", "Telefono fisso", "Telefono mobile", "Noleggio Auto", "Altro" ]
}
}
I’d like to make a condition to show a group of fields (or a single one like shown in my sample code) only if the scoped property array contains a specific field (i.e. “Gas”)
Here’s my ui schema entry:
{
"type": "Control",
"scope": "#/properties/gas_detail",
"label": "Dettaglio Gas",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/current_bills",
"schema": {
WhatCondition?
}
}
}
}
I’d be glad if someone could points me to a possible solution, or helps me understanding better the SchemaBasedCondition interface.
Honestly I was a bit overwhelmed by JSONForms and json-schema docs.
Thanks in advance
[original thread by blabs-dev]