Shiro Posted December 22, 2019 Report Share Posted December 22, 2019 Is there some way I can prevent the submission if none of my field is equal to specified value? I have three fields on my submission form. I want the submission form to only activate if at least one of them is equal to yes. Quote Link to comment Share on other sites More sharing options...
0 NiceDuck Posted December 22, 2019 Report Share Posted December 22, 2019 Hello Shiro, For this case, what I suggest is create another field on your data source table (preferably text 255) and check the unique checkbox. Then on your submission form, set it to calculated value and make an SQL statement like this: Case When '[field:aaa]' = 'yes' then SysUTCDateTime() When '[field:bbb]' = 'yes' then SysUTCDateTime() When '[field:ccc]' = 'yes' then SysUTCDateTime() end BAsically, what it does is it checks all the mentioned fields. if none of them is equal to 'yes', the value of this field will be null. However, since blank values are unacceptable on unique fields, it will prevent the submission. You just have to change the error message on the localization Hope it helps Quack Quote Link to comment Share on other sites More sharing options...
0 Shiro Posted December 22, 2019 Author Report Share Posted December 22, 2019 Whats the timestamp for? Quote Link to comment Share on other sites More sharing options...
0 NiceDuck Posted December 22, 2019 Report Share Posted December 22, 2019 The timestamp is for making sure that the values will be submitted will never be similar to those previously submitted records. You may want to add some strings to it which is relevant to the Data you are submitting. You may refer to this one: CONVERT(VARCHAR(10), SysUTCDateTime()) + 'test' Quack Quote Link to comment Share on other sites More sharing options...
0 NiceDuck Posted April 27, 2020 Report Share Posted April 27, 2020 Just an update, You can also just use a non 'text' field without setting them to unique. On this case you just have to set them to calculated value then give it an invalid value if the condition you want is not met. Quote Link to comment Share on other sites More sharing options...
Question
Shiro
Is there some way I can prevent the submission if none of my field is equal to specified value?
I have three fields on my submission form. I want the submission form to only activate if at least one of them is equal to yes.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.