I am trying to determine the shift based on datetime. Here is the use case:
However, it’s not working as expected according to the current code that I have ( Please see the attached screenshot) . The date in Appian writes with GMT adjustment .
Discussion posts and replies are publicly visible
Have you tried explicitly handling NULL values in your a!match() statement? hour() breaks if passed null. Just my first guess.
If so, the fix is pretty easy:
Thank you Mike for the updates. we have fixed the issue by adding a local time zone function a!match( value: rv!record['recordType!{942022df-8dbc-4911-b991-b4a48224c936}MECMS Case.fields.{213813ef-766f-4d3d-95c4-3d6963ed19bd}createdOn'], whenTrue:and( hour(local(fv!value)) >= 7, hour(local(fv!value)) < 15 ), then: "Shift 1", whenTrue: and( hour(local(fv!value)) >= 15, hour(local(fv!value)) < 23 ), then: "Shift 2", default: "Shift 3", )