07-12-2018 09:22 AM - edited 03-14-2019 06:20 PM
I have an error that keeps coming up when creating a formula in an IF element. I keep getting the error: "Unexpected token: less than" Do you want o ignore this error for now?
Here is my formula I'm trying to use which will test to see if the day is Friday (6) and the time for east timezone is > 5pm or 17.0. I want the function to run(calls go to service desk) from that time until Sunday at 7am west timezone
(weekday(<userZones_Eastern_DateTime>)=6&&
time (<userZones_Eastern_DateTime>)>time(17,0))||
(weekday(<userEastern_DateTime>)=7)||
((weekday(<userWestern_LocalTime>)=1&&
time(<userWestern_LocalTime>)<time(7,0))
What is causing the the error syntactically?
Thanks.
Solved! Go to Solution.
07-12-2018 01:04 PM
I'm going to take a guess and say that those User Variables are having their values set in some Admin script. They're likely setup as Global object types, so you'll have to call them as such. Something like this...
(weekday(Global.userZones_Eastern_DateTime)=6&&
time(Global.userZones_Eastern_DateTime)>time(17,0))||
(weekday(Global.userEastern_DateTime)=7)||
((weekday(Global.userWestern_LocalTime)=1&&
time(Global.userWestern_LocalTime)<time(7,0))
07-12-2018 11:43 AM
Is that the exact formula you're using? It won't like the less than and greater than symbols being used inside those parenthesis. If you put those in for aesthetics, then could you let us know if that's an ECC variable or a User Variable? If they're User Variables, what Data Type are they set to?
07-12-2018 12:45 PM
Those User Variables are type=Float.
When I removed the "<" & ">" from the script I get this error now
Undefined symbol: userZones_Eastern_DateTime
Do you want to ignore this error for now?
I've looked at the way the current scripts are designed and they use the "<" & ">" in a lot of them. I'm fairly new to this company and I'm still learning how they have things setup. Thanks for your help.
07-12-2018 01:04 PM
I'm going to take a guess and say that those User Variables are having their values set in some Admin script. They're likely setup as Global object types, so you'll have to call them as such. Something like this...
(weekday(Global.userZones_Eastern_DateTime)=6&&
time(Global.userZones_Eastern_DateTime)>time(17,0))||
(weekday(Global.userEastern_DateTime)=7)||
((weekday(Global.userWestern_LocalTime)=1&&
time(Global.userWestern_LocalTime)<time(7,0))
07-13-2018 07:35 AM
Thank you Omar! Yes they need to be declared as Global because the value was calculated in another admin script, and I had to have the "paren's" in the right places too.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide