You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Possible Bug: Workflow 10.4.1 Token Editor

posted on June 25, 2019

Hello,

It seems that if I use token formatting on the global Date variable inside of the Token Editor for a Substitute function, it ignores the formatting entirely.

For example, if I use %(Date#"yyyy-MM-dd"#)

The result I get from the Token Calculator when I actually run the workflow is "MM/dd/yyyy 12:00"

I tried wrapping the date token in TEXT(), but I got the same results.

If I put the date into a separate token first and use that token, everything works as expected, but it didn't seem like expected behavior.

0 0
replied on July 22, 2019

This is expected behavior. %(Date#"yyyy-MM-dd"#) is still a datetime, so you get back a datetime (and all dates are formatted to the OS format by default). You need to format the resulting token. Or do the substitution first and then format.

I'm guessing that when you assign %(Date#"yyyy-MM-dd"#)  to a new token, you left its type as string, so in that case, the resulting value after substitution is still a string.

1 0
replied on July 22, 2019

What would be the "proper" way to do this all in one task? I did create the new token as a string type to ensure the text was treated literally.

0 0
replied on July 23, 2019

What are you replacing in the date?

0 0
replied on July 23, 2019

I'm not actually replacing anything in the date itself. I'm running a workflow to update the filter date of a Forms report (since we can't use "Today" yet).

I use pattern matching to locate the current date filter, then the token calculator is replacing that with the current date so I can update the filter column.

0 0
replied on July 23, 2019

Oh, so it's something like this?

SUBSTITUTE(%(some URL),%(some pattern matching token for the existing date), %(Date#"yyyy-MM-dd"#) )

 

0 0
replied on July 23, 2019 Show version history

Yes, that's what I was going to do at first, but when I saw the time included in the date token, I changed it to set the new date in a string token first.

SUBSTITUTE(%(FindReportView_filters),%(GetFilterDate_Current Date),%(New Date))
0 0
replied on July 23, 2019

Hm, this looks like a bug with the runtime using a datetime for dates in Token Calculator. Formatting is not relevant here as you get the same result with just %(date).

Bug reference ID 184615. The workaround is to set the Date token into another one tagged as string.

1 0
replied on June 25, 2019

Hi Jason,

Thank you for bringing this up. I suggest reaching out to your Solution Provider directly to look into this specific issue, and if needed they can open up a support ticket on your behalf to resolve this issue.

We will take note of your comments internally to review.

0 1
You are not allowed to follow up in this post.

Sign in to reply to this post.