Workflow Wait Action - passing time to action index out of range error

I’ve been recently taking a look at forms recently and in doing so I was playing around with passing a time selection from a form to a workflow wait action. Since there doesn’t appear to be a way to select time with the date field, I was just trying an additional field, both a select one, and free text.

However, when I try and pass the value over from the form to the workflow Wait action, the wait action seems to always error out with the error:

runtime error: index out of range [1] with length 1

The date is set, and I’ve even tried hard setting the date within the wait action itself, but it seems whenever I try and pass time, whether that’s from the form, or defining a variable in the format HH:MM AM, I get this same error. I’ve tried times a few minutes out, some a few hours out, they all seem to get stuck for awhile and eventually error out.

Here is my most recent step input from a test:

{
  "date": "2024-05-03T16:00:00.000Z",
  "duration": "0m",
  "time": "10:10 AM",
  "type": "waitUntil"
}

Any ideas as to what I’m doing incorrectly?

Appreciate it.

1 Like

Afraid there’s not much more, this is from making even just a new workflow and the only actions being define variable → wait

{
	"name": "Wait",
	"description": "",
	"modified": "2024-05-03T14:08:36.111306392Z",
	"definition": {
		"start": "Define Variable",
		"steps": {
			"Define Variable": {
				"attributes": {
					"id": "sp:define-variable",
					"variables": [
						{
							"description": "",
							"name": "Time",
							"transforms": [],
							"variableA": "10:10 AM"
						}
					]
				},
				"displayName": "",
				"nextStep": "Wait",
				"type": "Mutation"
			},
			"End Step - Success": {
				"displayName": "",
				"type": "success"
			},
			"Wait": {
				"actionId": "sp:sleep",
				"attributes": {
					"date": "2024-05-03T16:00:00.000Z",
					"duration": "0m",
					"time.$": "$.defineVariable.time",
					"type": "waitUntil"
				},
				"displayName": "",
				"nextStep": "End Step - Success",
				"type": "action",
				"versionNumber": 1
			}
		}
	},
	"trigger": {
		"type": "EVENT",
		"attributes": {
			"id": "idn:post-provisioning"
		}
	}
}

Hi @JRDensmore, Please note: The “wait” action currently only supports specific times like 9:00 AM, 10:00 AM, etc and ISO 8601 time format. To ensure functionality, kindly use these formats when setting wait times. Try the below JSON:
{
“name”: “Wait”,
“description”: “”,
“definition”: {
“start”: “Wait”,
“steps”: {
“End Step - Success”: {
“displayName”: “”,
“type”: “success”
},
“Wait”: {
“actionId”: “sp:sleep”,
“attributes”: {
“date”: “2024-05-07T06:30:00.000Z”,
“duration”: “0m”,
“time”: “1970-01-01T04:30:00.000Z”,
“type”: “waitUntil”
},
“displayName”: “”,
“nextStep”: “End Step - Success”,
“type”: “action”,
“versionNumber”: 1
}
}
},
“trigger”: {
“type”: “EVENT”,
“attributes”: {
“id”: “idn:post-provisioning”
}
}
}

4 Likes

I appreciate you sharing the IIQ documentation. However, IDN workflows and forms differ significantly from those used in IIQ. Therefore, the IIQ documentation may not be directly applicable in this case.

2 Likes

Thanks for this!

I did figure out the format issue after looking at some inputs & outputs. Looking back it should have been obvious, but I got caught up looking at the help text being HH:MM AM, so I tried to pass it like that.

What I hadn’t figured out yet was that there was only specific times possible, so thank you for that!

“time”: “1970-01-01T04:30:00.000Z”,

I also noticed that your time is epoch date, which I’m assuming means we don’t need to worry about it matching the date field input, so that simplifies things too.

I’ll give this a go when I’m back in office.

let me know the outcome, and if it works, please feel free to mark it as solution

2 Likes

So, from what I played with I could only get the wait action to work with UTC times. Which is strange since the documention says it uses local time zone of the person who created the workflow to my understanding.

That being said, I was able to get it to work. It took a lot of tinkering to get it to work with the EST time I wanted end users to be able to submit from the form (while then also wanting to display EST time in an email action later too), but hey, it does work!

Essentially, my form value passes along the UTC ISO8601 values for the respective selected times. If that time means it would be the next day, I had to do checks on the time string to then have the workflow add one day to the selected date for the action. I also had to do some funky variable trimmings & concatenation to provide the times back in EST.

Appreciate the help!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.