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

Question

Question

create document based on database query

asked on August 7, 2014

 I have a very sql database that is updated each morning.  Will have maybe 30 records.  I want to do the following:

1.  Count the number of records in the database    then...

2.  Create a document for each one of them by copying a current document   and then....

3.  Rename each of those newly created documents with the 'name' value from the db query

4.  Final step would be to apply a 'text box' to the newly created document with the 'name' value  (that I will later use QF to do zonal ocr on)

 

I tried using the 'For Each Entry' but I get the error 'No activities in this workflow provide relevant data'.  My steps are 1) For Each Entry 2) Query Data (PersonName=%(Entry Name)); 3) Create Entry

 

I have tried moving the create at the beginning...but you need the db query to create the document.

 

 

 

0 0

Answer

SELECTED ANSWER
replied on August 7, 2014

You should do  a Query first for all rows in the database, then use the "For Each Row".

 

"For Each Entry" is used in conjunction with "Find Entries" or "Search Repository" activities. 

 

For any of the "For Each..." activities though, you will need to prepare data for it to use.

0 0

Replies

replied on August 7, 2014

Hi Bonnie,

 

You need the "query data" node first.

Then you need to use the "for each row" node winksmiley

 

Like this....

this will perform a set of actions for each row in the table laugh

 

(I only know this because I tried to do exactly what you are trying to do yesterday)

 

Hope this helps yes

0 0
replied on August 7, 2014

You want to use For Each Row since Query Data returns a set of results rather than a set of entries. The order of the activities would be more like this:

  1. Query Data to get the new records from SQL
  2. For Each Row to go through the SQL results
  3. Inside For Each Row:
  • Move Entry to copy the current doc
  • Rename Entry to set the new name
  • Add Text Box

 

However, Zone OCR will not read text box annotation from the document. But since you have the value in the document name, that shouldn't really be a problem later on.

0 0
replied on August 15, 2014

Hi Bonnie, 

 

If your question has been answered, please let us know by clicking the "This answered my question" button on the response.

 

If you still need assistance with this matter, just update this thread. Thanks!

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

Sign in to reply to this post.