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

Question

Question

Use workflow to query two folders, match and merge documents with same metadata field

asked on June 20, 2014

 We have two folders in LF that we would like workflow to monitor and merge documents with same field data. One folder is for work requests and the other is for work orders.  The work request is populated with requests from customers and once the work is completed the work order is scanned and indexed into the work order folder.  Trying to configure workflow to match documents in both folders with the same work order #, merge the documents together and then move the combined document to a work completed folder. Please advise. 

 

Thanks,

0 0

Replies

replied on June 20, 2014 Show version history

This one should be pretty simple. You just need to be able to do a search for documents within the work request folder by using the "Work order number" (or something similar) from a document in the work order folder. Then move the pages over.

 

1 0
replied on June 23, 2014

You're going to get your completed work orders from a starting rule that watches the completed folder. Then you take that document, pull the work order number out of it and use that to do the search. Then your Move Pages activity is going to move from the Starting Entry to the document that was found by the search.

 

1 0
replied on June 23, 2014

I'm missing something.  For simplicity I'm referring to work request folder as folder A, work order as folder B and the two combined as folder C. 

 

1. For the "Search Repository" I'm using the following query. 

 

{[]:[Job Work Order #]="*"} & {LF:LOOKIN="Cubix\TESTING\A"}

 

2. . The "For Each Entry " uses the Output entry of Search Depository as its the only option

 

3.  The "Move Pages", which I'm sure this is where my issue is, I'm confused how this matches documents in folder A to folder B, combines them and moves to folder C. 

 

Do I need to have two separate "Search Repository" one pointing to Folder A and one to Folder B?

 

 

0 0
replied on June 24, 2014

This seems like it would be so simple but I can not get it to work.  I have tried every combination and continue to get the error  "No entry specified" on the "move pages" function. 

 

Starting rule monitors the completed folder

 

Unclear on how to "Take that document, pull the work order number out of it and use that to do the search."  Is this done with the retrieve field values function?

 

I'm not understanding how to query the work complete and work orders folders, then combine the documents with the same work order #.

 

0 0
replied on June 24, 2014

Here's a more fleshed out and better annotated version:

 

The Search Repository activity needs an Advanced Search Syntax string. You can build that by building the search you need in the client, using "Within Folder" and "Field Search". Then show the "Advanced Search" option and copy the text out of it. The raw text is going to look something like this:

{[Work Order]:[Work Order Number]="1234"} & {LF:LOOKIN="Repository\Work Requests\"}

You then want to paste it into the Search Repository activity. Then click the chevron button next to the Search Query box and open up the Token Dialog.

 

Put your cursor on the order number (in this case 1234) and delete the number. Leave the cursor inside the double quotes and use the token tree view down below to select the Work Order Number token from the Retrieve Field Values activity. It will insert some blue text with the name of the field. You can then click OK.

 

Does that make sense?

1 0
replied on June 24, 2014 Show version history

Hi Loren,

 

I really like Devin's idea here.  The workflow Devin is suggesting would involve Workflow monitoring the Work Order folder for any work order who get's their metadata updated to reflect that the order is complete.  That would be the starting entry in this case.  That entry should also have the Work Order # in the metadata, which can be extracted by Workflow using the "Retrieve Field Values" activity. 

Once Workflow has the work order that was completed and the corresponding work order number, you can run a search like this:

{[]:[Job Work Order #]="%(RetrieveFieldValues_WorkOrderNumber)"} & {LF:LOOKIN="Cubix\TESTING\A"}

**Keep in mind the search will need to be modified for reflect the appropriate token name and folder path

That search, in plain english, will look in the "Cubix\TESTING\A" folder for any documents which have the same Work Order # as the starting entry.  Once you have both of those entries in your workflow, you can use the "Move Pages" activity (remember to change your source and target entries when configuring the activity).  

Hopefully this clears it up a bit, but please respond if you'd like any further guidance!

0 0
replied on June 24, 2014

Thank you for the more detailed description of the steps!! When I have the retrieve field values as my first step in the workflow I receive the error. "No entry was specified on the Retrieve Field Values step. Can you post screen shots of how the starting rule should be configured?  I have mine pointing at the completed folder which contains two documents with the "work order #" metadata field filled out.  Not sure why the Retrieve Field Values is not pulling the work order # from the two documents?

 

Thanks,

 

Loren

0 0
replied on June 24, 2014 Show version history

How do you have your starting rule configured? A starting rule needs to have an event to trigger it. If there's already documents in the folder, you'd need to have a changed event. It's up to  you to configure it with your particular criteria. Do you need it to trigger when the work order document is created, or when a work order document has some value changed?

 

A simple create starting rule will look something like this:

Starting Event: Entry Created
Run workflow on the entry that was created

If all of these conditions are true
        Entry : Path equals \Repo\Work Orders\

I suggest you review the starting rules documentation to find information on how to fill your specific requirements.

 

How are you currently starting the workflow? Are you using the "Run Current Workflow" button in the designer? That might cause errors because if you don't supply a starting entry, there's nothing for the other activities to work with.

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

Sign in to reply to this post.