cancel
Showing results for 
Search instead for 
Did you mean: 
jwiskema
Nintex Newbie

check if document in folder has specific text

Hi Everyone,

I have a weird requirement.  I have a document library that has a folder [test1] inside that folder is document1 and document2.  I need to run a workflow on the folder and see if any document comes back with '2' in the name and if it doesn't, send out an email.  Any suggestions on how I would go about this is appreciated!

Thanks!

Jennifer

Tags (1)
0 Kudos
Reply
3 Replies
murphybp2
Nintex Newbie

Re: check if document in folder has specific text

You can't run a workflow on a folder.  You can run it on the list, or the site.  I'd recommend doing a site workflow.  It's a 2 step process.

  1. Find all the documents that match your criteria
  2. Determine if the documents are in the specific folder.

For part 1, use the Query List action to query the library this folder is in.  Make sure to check the box for "Recursive".  This makes it search within folder.  Set your criteria to look for any documents where the Name contains 2.  (or does not contain 2.  I didn't exactly understand your conditions if you want to send out the notification if has 2 or doesn't have 2).  I would return the ID field and create a collection variable to store it.

For part 2, once you have the collection of ID's, you now need to determine if the document is in the specific folder.  Use a For Each to loop through the collection.  For each ID, query the list again for that document, and pull back the URL Path of the document.  You can use a Regular Expression action to remove the file name to get just the path.  Then evaluate that url to see if it matches the path of your folder.  If it does, then you can send out your email.  

Reply
jwiskema
Nintex Newbie

Re: check if document in folder has specific text

Thank you for the quick reply, I am building the workflow now.

Thanks again!
Jennifer

Reply
Automation Master
Automation Master

Re: check if document in folder has specific text

Jennifer if you succeed with suggestion from Brendan please do not forget to mark his answer as "Correct"

Regards,

Tomasz

0 Kudos
Reply