Constraining a time based on another time

98
2
Jump to solution
03-29-2022 11:27 AM
JeffreyFitzgibbons
New Contributor II

Hello, I am trying to constrain a field called 'sampletime' based on another time field, 'parameter_time1'. Basically I would like the 'sampletime' field to be later than the 'parameter_time1' field, but only if there is a value (a time entry in 'parameter_time1'). If there is no entry, then the constraint shouldn't apply. Here is what I have in the constraint field for 'sampletime':

 if(string-length(${parameter_time1}) > 0, '.>${parameter_time1}')

But the constraint of .>${parameter_time1} is applied even when parameter_time1 is blank. Any ideas on what I'm doing wrong? 

0 Kudos
1 Solution

Accepted Solutions
DeonLengton
Esri Contributor

Hi

if(string-length(${parameter_time1})>0,.>${parameter_time1},true())

This seems to work for me in the constraints column of parameter_time.

First check if parameter_time1 was provided, if it was then check that parameter_time is bigger than parameter_time1

Hope that helps - i think you had some quotes in there that wasnt necessary.

 

View solution in original post

0 Kudos
2 Replies
DeonLengton
Esri Contributor

Hi

if(string-length(${parameter_time1})>0,.>${parameter_time1},true())

This seems to work for me in the constraints column of parameter_time.

First check if parameter_time1 was provided, if it was then check that parameter_time is bigger than parameter_time1

Hope that helps - i think you had some quotes in there that wasnt necessary.

 

0 Kudos
JeffreyFitzgibbons
New Contributor II

This worked, thank you. I think I was staring at it for too long 🙂

0 Kudos