Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
how to validate provided email address is in correct format?
in below case i can try anything without any format, can do validation here with certain domain?
{
"name": "requester_email",
"label": "Requester's email id",
"type": "STRINGS",
"allowDuplicates": false,
"description": "Please enter the requester's email id",
"mandatory": true
}
Hi,
There are no capabilities to validate emails in the frontend. You would need to do that in the backend (i.e. in your Python code) at runtime.
You could for example use the standard Python library function email.utils.parseaddr for that (https://docs.python.org/3/library/email.utils.html#email.utils.parseaddr)
can we access JSON frontend from python in DSS plug in , any example would help
The exact manner depends on what kind of plugin component you are developing (recipe, macro, dataset, trigger, step, ...).
But ultimately, every custom component will receive its configuration, since that's the foundational way that plugins work, and you can do this validation at the time of running and outputing a clear error message.
Validating at edition time would require you to write a fully custom UI and backend. It is a significant challenge and is a lengthy process. We have a documentation here https://doc.dataiku.com/dss/latest/plugins/reference/other.html#custom-settings-ui
we are using macros, how to outputing a clear error message? any examples available.