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

Question

Question

Advanced Workflow search syntax using tokens

asked on March 12, 2015

In a workflow, when doing a repository search, I'm trying to figure out a way to search a repository using a token?  I was hoping to perform a regular search for items in a folder more than two weeks old, and I was going to refine my repository (folder) search for a Date Modified that is more than two weeks ago (i.e. %(Date) - 14).  From this, I was going to send out notifications to anyone with files more than two weeks old in their own folders as a "friendly" reminder to do something with them. :)

Please let me know if anyone has any suggestions on if this is possible - thanks!

Marty Gaffney - Network Technician

Town of Okotoks 

 

0 0

Answer

SELECTED ANSWER
replied on March 13, 2015

Hey Marty,

 

This is definitely possible! Workflow has a Search Repository activity, which allows your Workflow definition to run searches, and then run activities on the results, just like a user.

The Search Repository activity will require the search syntax, which tells Workflow what to search for. You can generate this by performing an custom search, as below:

 

With the Advanced Search tool, when you configure your custom search, this will generate the search syntax for that search. What you can do is configure your search for today's date and copy the syntax into the Workflow Designer.

Then you will want to replace the syntax's date with a token, equal to the value of today's date minus 14 days. (Use the Date Token Calculator activity to create a new token with the value you want and place this into the syntax, replacing the fixed value).

After this, you can use a For Each Entry activity to run a collection of activities on each of the search results!

Let me know if you have any questions.

2 0

Replies

replied on March 15, 2017

I have followed the instructions provided above, but I continue to receive an error.  When I test the query, a box pops up that requests the "value" of the date token (Image 4).  When I run the workflow, I am receiving a syntax error(Image 5).  Are you able to determine from the screenshots what I am doing incorrectly?

Image 1

Image 2

Image 3

Image 4

Image 5

1 0
replied on March 15, 2017

The Define Token Values dialog is normal when testing the activity since Workflow doesn't run the previous activities to figure out token values.

As far as the error, I think it's because you have => instead of >=.

1 0
replied on March 15, 2017

Thank you for your quick response!  That was the problem. 

1 0
replied on March 13, 2015 Show version history

Thanks for the quick reply, Nathan!

I was almost there, I just had to actually run through the workflow again.  When I went to test the search, I was being prompted to enter in a value, so I thought the token wasn't being referenced (and therefore accepted) within my query.  Ran the workflow, tracked the results, and what do you know.  I also realized one of the problems might have been that I had created my token prior to referencing it, so I moved the Date Token Calculator task up above the Search Repository function. enlightened

Much appreciated, thanks much! laugh

Marty Gaffney - Network Technician

Town of Okotoks

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

Sign in to reply to this post.