Workflow Error when returning an arcade date object
Good afternoon, I'm seeing a bit of odd behavior, and just wondering if anyone has experienced this or has any insight as to what may be causing this.
I've created a very simple workflow as an example, all it does is run an arcade expression that returns a date (workflow attached). There is a lot more to this arcade expression normally, however I’ve narrowed the error down to returning a date object from an arcade expression. When I run this workflow from the sandbox it works as expected and returns.
When I hook this workflow up to a button in Web Viewer 5, the date is not returned rather just a blank object {}. I've attached the simple Web 5 viewer that I’ve been using try to debug the error. When I return anything that isn't a date (string, int, bool) from the arcade expression it works normally in Web, just not when a date is returned. The error returned is https://reactjs.org/docs/error-decoder.html/?invariant=31
I've run the arcade code in the arcade playground and it works correctly, it just seems to be when running the workflow out of the web viewer that is doesn't work.
WF5 - 5.23.0
WebViewer 5 - 5.14.0
Any advice or next steps would be appreciated.
-
What is returned from your Run Arcade Script is a date object. You cannot just print that object out directly like you try to in your workflow. But if you try to print =$ConceptError1.result.toString(), you get the full date string printed out. In the same way, you could call =$ConceptError1.result.getDate() to get today's day or =$ConceptError1.result.getFullYear() to get today's year. A tip is that you can use the Format Date activity to get a string representation of your date object in the way that you want.
I'm not sure why your workflow acted differently in Sandbox. I haven't tried it.
0 -
Hi Jostein, I apologize I didn't explain this well enough. The printing has nothing to do with the error that was just a way for visual testing. You can completely pull the logging/alerts out and get the same result.
The workflows that this is apart of were all working normally before updating the WF/Web5 versions to the most current. That is when this error began.
Thanks,
Shawn
0 -
Just a follow up I solved the problem with arcade expressions by just moving to a regular JS expression using the "evaluate expression" tool. This works as expected using normal JS, where as using arcade to return a date is causing odd behavior in the code.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
3 kommentarer