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

Question

Question

How to query - Folders that recently had a field change value

asked on August 7, 2017 Show version history

I have a project that I'm working on that I need some help on.  Kind of new to this whole thing.  I will explain, it's pretty simple.

 

I have a folder that contains three folders - the three folders are labeled.  OPEN, CLOSED and ARCHIVED.  Inside each of these are client folders.  The location of the client folder depends on if the client case is OPEN, CLOSED or ARCHIVED.  The client folder has a template with a field named CASE STATUS which includes the three options of OPEN, CLOSED & ARCHIVED.  

Example;

What I want to do is if the CASE STATUS field changes to run a workflow that moves the folder to the appropriate folder.   In the above example I have Jane Doe as an open case.  The CASE STATUS field of the DOE, JANE folder is currently set as OPEN.  If the user now wants to close the case they would simply change the CASE STATUS to CLOSED.  Workflow would move the DOE, JANE folder under the CLOSED folder.  

I don't really want to loop through all the folders each time one changes so I want to locate and change just the one that has changed.  The big question is how do I create a query that locates just the folder that recently had a value change in the CASE STATUS field?  

 

 

 

 

0 0

Answer

SELECTED ANSWER
replied on August 7, 2017

You definitely want to look into starting rules.

Since your users adjust the status on the client folder, you don't need a search, Workflow knows when that happens and which folder it happened on.

So a Workflow definition like this should work:

 

(the starting entry in this case is the folder that was changed. Workflow reads its field, uses pattern matching to trim the current location off the path and move it into the folder named after the updated field value.)

For starting rules, try something like this:

(note the "entry changed" event).

0 0

Replies

replied on August 7, 2017

Why do you need a query? Why not just have your workflow start on "entry changed" events?

1 0
replied on August 7, 2017 Show version history

Correct - This is the part that I might be missing.  How do I specify in the workflow which folder to update?  My workflow was going to query for the folders that changed and then within the For Each activity move the folder based on the selection in the CASE STATUS field.  The workflow would be triggered by 'entry changed' event.  

Is there a different way?

 

The workflow I was thinking of would be like this.

 

0 0
SELECTED ANSWER
replied on August 7, 2017

You definitely want to look into starting rules.

Since your users adjust the status on the client folder, you don't need a search, Workflow knows when that happens and which folder it happened on.

So a Workflow definition like this should work:

 

(the starting entry in this case is the folder that was changed. Workflow reads its field, uses pattern matching to trim the current location off the path and move it into the folder named after the updated field value.)

For starting rules, try something like this:

(note the "entry changed" event).

0 0
replied on August 7, 2017

That worked perfectly.  I need to learn more about how to put together the patterns.  Where would I go to get information on the syntax for creating the patterns?  We are using 10.2.  Thank you very much!

0 0
replied on August 8, 2017

The syntax is in the help file (along with some links to Microsoft's documentation for the .Net regular expressions class, which Workflow uses internally).

The one above, (.+)\\[^\\], extracts everything ("(.+)") before the last subfolder in the path: "\\" is the backslash in the path, with special notation because the backslash is a reserved character. The last folder's name itself is represented as "anything but a backslash". The parentheses indicate a match group, or in other words differentiate between what will be extracted and what is there just to ensure the right pattern.

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

Sign in to reply to this post.