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

Question

Question

Removing time from a Date/Time field for Search Query in Workflow

asked on March 8, 2019

I have a Search Repository activity in Workflow and I am trying to use just the date portion of the BP Start Date as part of my filename.  Here is a test of the Search Repository activity test with the date typed as I need it:

and here is the result:

This is the setting I used in the Token Dialog:

This is what the BP Start Date looks like:

Here is what I used as data for another Test of the Search Repository:

and here is the result of the second test:

As you can see from the screenshots the Token Dialog Test Value clearly shows the time is removed utilizing the #"d"# format setting.  I don't get why the second test returns a 0 result.  From what I can tell the #"d"# formatting should remove the time from the BP Start Date and only utilize the "3/6/2019" part of the datetime.  Anyone come across this?

0 0

Answer

SELECTED ANSWER
replied on March 11, 2019

This is most likely happening because you're entering a datetime in your Define Token Values dialog. This dialog doesn't do any token parsing, it uses the value as-is.

0 0
replied on March 11, 2019

Are you talking about the datetime value I am typing to test the Search Repository query? I am assuming that the token parsing doesn't work on the BP_Start_Date because when I submit my form, save it to the repository, then call the workflow to find the file with the BP_Start_Date as part of the filename the file is not found.  What I ended up doing is creating a hidden date field variable that saves "Current Date" when the form is submitted.  Then I am using that date in the Search Repository query.

0 0
replied on March 15, 2019

OK the hidden date field saving the _CurrentDate didn't quite work out.  During one of our tests it saved a date one day prior to the submission date and I couldn't figure out why.  I went back to using the BP_Start_Date and Apply Formatting "d" in the Token Dialog.  I am dumbfounded because now that seems to work where as it didn't before.  

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.