how to generate JSON from type select
we have created dss plugin with macros and we have runnable.json where we create UI and one of the requirement is to list users where we have users list from excel how to generate JSON from that same
sample json as below, so now this JSOn is not accepted so we have to manually edit JSON that supports in DSS, we have around 1000 array objects but it is not feasible how to achieve this?
{
"label": "abc",
"options": [{
"label": "dss_training",
"value": "t::dss_training"
}
]
}, {
"label": "xyz",
"options": [{
"label": "dss_d",
"value": "id::dss_d"
}, {
"label": "dss_p",
"value": "id::dss_p"
}, {
"label": "dss_training",
"value": "id::dss_training"
}
]
}
Answers
-
-
Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 319 Neuron
Hi, it sounds like issue is populating a select item in the macro UI from a list of around a 1000 users. So it doesn't seem to be same issue I was running into.
Maybe the option to populate a select item from Python as described in the documentation (i.e., getChoicesFromPython) would be the way to go. Seems like a good fit for this use case.
Marlan
-
hi @Marlan
, thank you , i tried getChoicesFromPython and getting some error, as we have runnable.json for all UI controls, can we use getChoicesFromPython for just one dropdown? if we have multiple on same page?any examples would help
-
Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 319 Neuron
Sorry, I don't have any examples as I have not used the Python option. Seems like it should work in your case but again, I haven't done it.
Marlan
-
Hi @Madhuri
let me check -
thank you @Marlan
let me check