Using The Global Field 'Task Status'
I am getting inconsistent results when trying to use the global field (love global fields!) for a task status:
tasks["task-name"].status
I know I need to use Field Formulas and go
result = tasks["task-name"].status
per the help documentation at https://help.catalytic.com/docs/globally-available-fields/
In the first example (graphic), it showsresult = tasks["assign-task"].status
In the second example, it has a quotation mark at the end:result = tasks["task-name"].completedBy"
I have only got this to work once (I don't use the quotation mark). When I try to copy the same format in a different bot, I get an error:
Error executing code for field "status": There was no result found in your code. Use result = fields.fields1
I have tried building a short and simple workflow to test this. The first step getting the date and time, then the next step just getting the status of the previous step:
The above throws the error I mentioned... Please help!
Thanks,
Kevin
Best Answer
-
@Kevin_579059 the second example you mention in the help docs
result = tasks["task-name"].completedBy"
has an error. It should beresult = tasks["task-name"].completedBy
without the"
. We will get that fixed, thank you for reporting that.For tasks, you must reference the task name as it displays in the address bar when viewing the task:
If you've renamed a task (from "Get Date" to "getdate"), the task name will be based on the original task name ("get-date" instead of "getdate").If you are ever struggling to debug tasks what you can do is use a field formula like
result = JSON.stringify(tasks)
. That will show you the full tasks object we make available. Please keep in mind that only the fields specified in the help document are supported. All other fields you see on the task are internal and subject to change without notice.Hope this helps!
5
Answers
-
Thanks, Dylan!
This worked! I changed the task name to get rid of the space and have a one word task, because sometimes programs don't like spaces LOL.
I tried the JSON task trick - it produced two pages of stuff for just a 4 step process! Good to know for future de-bugging.
Kevin2 -
@Kevin_579059 great, glad it worked for you!
And yes, the JSON task trick produces a LOT of text.
0