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

Question

Question

For Each Value - remove data after processed.

asked on October 6, 2014

Hi Guys,

Apologies if this has been covered in previous entries but cannot find an answer to my exact query.

I have a multi value field (Invoices) that I would like to process each value and then depending on a search repository result move to another mutli value field (Missing Invoices or Found Invoices) .

The only bit I cannot work out is to remove the processed value from the original mutli value field without affecting the remaining values.

I have attached image;

 

Cheers

 

Ross

 

0 0

Replies

replied on October 7, 2014

Hi Ross,

 

So if I understand correctly you want to clear the original values? But you also need to write data into the same field? If you want to do this then you will need to write the value somewhere else temporarily (perhaps a SQL table) then you can assign it back to the field after you have cleared it.

 

Or. Perhaps you could use the assign token function here? Although I'm not sure at what point in generates the token or if it references it when called on (in which case it would be empty). Certainly worth a try though.

 

My advice here would be to just write the data to a different field and clear the original field. That would be much easier to implement.

 

Hope this helps Ross! yes

0 0
replied on October 7, 2014 Show version history

If I understand this correctly, you could create a multi-value token before this "For Each Value" and assign it the original multi-value token. As you process the values in the original token, when "Found" you assign the token itself, but add to it the function of "Remove" with the token for "CurrentValue" from the Token Editor. After you finish looping through the values, you replace the original field with the new token you have with all the missing invoices. 

 

Is that what you are looking for? 

 

EDIT:

I realized that you have warnings on those two fields. If the Invoices Field has all the invoices values in there, and you want to rebuild those found and missing invoice fields, you should precede this "For Each Value" activity with a "Assign Field Values" and Clear those two multi-value fields. You assign those two "Assign Field Values" tokens to append to the values of those fields and it will run without conflict.

 

Alternatively, you can create two multi-value tokens with the initial value of the multi-value token from the "Invoices" field. In each of the branch you would re-assign the relevant token to be itself, but "Remove" the current value from itself. In the left branch, this would be to remove from the multi-value token of "MissingInvoices" the current value. In the right branch, it would remove from the multi-value token for "FoundInvoices" the current value. After the "For Each Value" activity completes, you would then assign the "Found Invoices" and "Missing Invoices" it's respective multi-value token, telling it to replace the current values in those fields. This would ensure that the field constantly has values even if something happens to cause the workflow to fail in the middle of its runtime.

0 0
replied on October 7, 2014

Can you give us more information about how your folder and template structure and how you plan on starting this workflow? If I'm guessing correctly from the screenshot above you are planning on having this workflow run on a schedule and reprocess all documents regardless of whether they changed or not? That's going to be very inefficient in any size repository.

0 0
replied on October 7, 2014

Hi Guys,

Thank you for the responses and apologies for not being clear on the requirements.  I will try to explain that now;

The workflow is aimed at assisting the accounts payable department.  The department pay vendors from statements not invoices, they have trouble matching up the invoices when the statement comes in from the vendor.

I have two workflows- one for invoices and one for statements.

First - Invoices scanned/imported into Laserfiche and invoice template assigned, invoice goes through a approval process if needed and then sits in a folder path of "Invoices\2. In Progress\{Vendor}". This workflow is completed.

Second - When the statement comes in, scan the statement in, apply statement template and then input the invoice numbers from the statement into the invoices field on the template, workflow then searches for each invoice value in the invoice field for scanned invoices in "Invoices\2. In Progress\{Vendor}". 

If found, leave it in the Invoices field.

If not found, move it into the "MissingInvoices" multivalue field and remove from the invoices field.

Basically I was hoping of an easy way to transverse through a multi-value field and remove the current value from the original multi-value field?  Not sure if I am missing something simple here.

I have some more stuff to implement like linking invoice to statement, when statement is paid go back to original invoice and fill in paid ref etc but that will come later.

Miruna, both workflow starts on a condition.

This is the incomplete Statement workflow so far;

 

Thanks for your assistance guys.

Cheers

Ross

 

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

Sign in to reply to this post.