ShotGrid has released new Input Validation capabilities for system created Entity Name Fields (e.g. Shot Code, Sequence Name, Asset Name, and etc.). This workflow allows users to configure validation rules i.e. define specific input requirements that need to be met in order for the data to be accepted into ShotGrid. Once a validation rule is created, it can be applied to the desired projects on a site.
Hi,
seeing field validation is a great addition, even though we have our internal validation happening on an Event Listener.
But it would not hurt to warn users upfront instead of having the Event Listener nagging a few seconds later.
While I was testing the validation it confused me very much that (it seems) I can define those rules only per project, and even more confusing canāt set them up on a template project (so they will be picked up automatically for newer projects).
As most studios have rules and naming conventions for all projects, I guess this must be something of great interest.
Could it be that I just overlooked something?
How can I define validation rules for all (future) projects?
Thanks,
Tobi
Hi @pixelconductor, thanks for your interest in the new Input Validation feature! To answer your question, there isnāt a way to add validation rules for all (future) projects. You can apply an existing validation rule to a new project by launching the Configure Field dialog from a page where the rule is enabled. Then navigate to the Validation tab in the dialog and add additional projects by following these steps.
We are continuing to collect feedback for potential future improvements on Input Validation, and have taken note of this request. For us to better understand your requirements, may I ask how many projects you are creating and how many validation rules you are trying to apply to these projects?
Hi Xin,
thank you for your response!
We are creating about a project per month. Going through all neccesary validations and re-applying them to a new project would be cumbersome, prone to errors and might be forgotten on a regular basis.
Being able to apply the rules via the API would kind of solve the problem as we would let the Event Listener take care of the rules then.
I actually donāt see a single validation rule usecase (for us) which I want to apply that should not be globally working. In general its about covering naming conventions to make sure that downstream pipeline tools will work, or field formattings (check if its a valid email).
Both of theses things are very much global defauls for me.
Your validation rule options are powerful enough to make these things globally working for me, even though I would have liked regex support to show up.
Consider this a feature request to either create global rules or at least to be able to apply them to template projects.
Currently we do not support space characters in the special character list for input validation rules. We have added this to our list of requests for consideration in future enhancements.
@slewery Iād like to add to @taiello 's request that this would be a useful addition. Weāre trying to validate a Description field and spaces are to be expected in its contents. I see no reason why the space character shouldnāt be an option for someone to use. Iād personally like to see the new-line or carriage-return character available as well - more options gives the existing validation system more utility and less need for users to build solutions circumventing its limitations.
Weāve created a ticket for the āspaceā special character and weāll also look into the carriage return idea. I canāt commit to when this work will be done, but our team is looking at it and Iāll lat you know when itās available.
Appreciate the response @warren.trezevant - Iāll keep my eyes peeled for whenever that may be! Validations are super handy for a large number of things already, so hopefully this will just add to the list of useful stuff you can do with it.
Thanks for your suggestion. We have added space character support to our list of upcoming enhancements and will take a look at whether we can include newlines with this.
Validation should be available in the configure field window. Please note, that you wonāt see the tab displayed for demo or template projects or when viewing a project based entity in a global (non-project) context. Validation is currently supported for text, currency percentage, float and number types.
We donāt currently support validation for mult-entity fields but we will add this to the list of features for consideration.
How can we check for the validation rules within our REST/python API calls? When doing the schema_field_read command in python on the entity field where the rules are set, Iām not seeing an entry with the specified rules, just whether or not itās editable, unique etc. Is there a different command that is used for this?
Thanks for your question! We currently donāt support returning the validation rule with schema fetch calls in our apis. We are currently working on improving the experience of using validation with the APIs and I have added your request to our items for consideration for future releases.
Regards,
Stefan
My apologies,
You should actually currently be able to retrieve some information on the rule with your schema call.
eg.
{{host}}/api/v1/schema/Shot/fields/code?project_id=<project_id>.
Will return a block indicating the message, description, enforcement type and rule type.
Wanted to let everyone in the channel know the ShotGrid team recently added the ability to use spaces when setting up Input Validation rules.
To learn more about this enhancement, be sure to check out our updated documentation here
Weāre excited to continue offering value to this important feature and would like to hear from you any feedback you have on how youāre benefitting from Input Validation or what else we could add to help you utilize it more effectively at your studio.
I just started to use a validation rule. In our case, we want to prevent the use of underscores in shot and asset names. I managed to make the rule but I would like to enable it on future projects. When we create a project we use a ātemplate projectā as a template. Opened that ātemplate projectā and tried to apply the validation rule (or rebuild it there), but when I right-click a field in that project and go to the configuration page for that field, the āVALIDATIONā tab doesnāt show up.
How should I proceed to ensure future projects will inherit my validation rule ?
The good news is our team is currently working on providing the ability to include validation rules in templates and weāre hoping to make it available sometime in the New Year. As soon as itās ready, Iāll be sure to let you know so you can validate the workflow with your team.
Have a wonderful holiday break and Iāll reach out again soon.