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

Question

Question

Quick Fields - Remove final value from multivalue Zone OCR token

asked on July 19, 2017

Hello!

I'm working with a document that has a column of values that I'm trying to extract using Zone OCR.  This column can contain anywhere from 1 to 20 values. These values are a list of invoice amounts followed by a grand total as the last value in the column.  The Zone OCR region has been configured to read multiple lines and create a multivalue token from the results.  

Currently Quick Fields is storing all values, including the "grand total", in the multivalue field I created.  I'd like to remove this grand total from the list of values.

I've tried using the "Remove" function at a token value that's reading the final value in pre-processing.  Although I've confirmed the token value is correct, the remove function doesn't seem to catch that the token matches a value in the list.

I've also tried using the "Remove At" function and providing the index of the number of values using tokens, also with no success.

 

Please let me know if I'm missing something obvious or if there's another way to go about this.

 

Thank you in advance!

0 0

Answer

SELECTED ANSWER
replied on July 26, 2017 Show version history

Bug reference # 36071. Use RemoveAt(-1) instead.

2 0
replied on July 27, 2017

You're awesome, Miruna!  Worked like a charm :)

 

Thank you as well, Alan, for looking into the issue!

0 0

Replies

replied on July 26, 2017

Hey Rob,

Have you tried using the "Value Count" function in the Token Editor? Basically you can use the value count function to convert your values into a number and then use that number in the "Remove At" function.

The example would be if you had 10 values in your multi-value field, the value count function would change the value of the field to "10". You can then use that "10" value in the remove at function to say "Remove at 10" which will remove the last value in your multiple value field each time. 

You will probably need to use the "Assign Token" activity to modify your tokens though.

Let me know if that doesn't work!

2 0
replied on July 26, 2017

hmm you're right I can't seem to get it to resolve my token value either in Quick Fields. I'm going to do a little more research and get back to you on this.

1 0
replied on July 26, 2017

Thanks dude!  In a worst case scenario, we can use WF to remove the final value, but I was hoping to avoid the confusion for the end user.  Either way, I'm curious to hear what your findings are!

0 0
replied on July 26, 2017

Yo Alan!  

Yeah I tried the "Remove At" function.  

 

I think the issue regarding why the "Remove At" function isn't working is because I'm feeding the function a token rather than a static value.  As you can see in the Invoice Amount field, there's a field with value "Net Amount".  I confirmed that I can use "Remove At" index 1 to remove that field, and also confirmed that I can use "Remove At" 7 to remove the total, but keep in mind, although the screenshots show the max index at 7, not all documents will have the same amount of line items, and will change the max index.

 

Are there other options you can think of that I might be missing?

Token_Editor.png
Max_Index_Count_7.png
Zone_5.png
Token_Editor.png (22.17 KB)
Zone_5.png (2.39 KB)
0 0
replied on July 26, 2017 Show version history

In your screenshot you're using a token for the remove at function which should work the same as if you plugged in a static number in there. I tested this in workflow (with random fields that were multi-valued) mainly because it was easier to create fake data for. This is what I got:

 

 

 

This worked for me in workflow where it always removed the last item in the multi-value field. You should have the same function is Quick Fields as well. 

If you want, you can send over the QF session with a sample document to the presales inbox and I can take a deeper dive into your session.

1 0
replied on July 26, 2017 Show version history

We actually were required to sign an NDA to receive the samples, so I don't think I can send over the exact documents I'm working with but I do appreciate the offer.  It should be easy enough to create some samples for QF; just create 2 word docs, create a dummy list of variable length on each, import to LF and generate pages.

I have no doubts that WF is able to accomplish this, but all the evidence I've found is pointing to the fact that the "Remove At" function is unable to resolve the token I'm feeding it.  For example, as I mentioned, if I type 7 into the "Remove At" function, it will remove the 7th value.  If I use Assign Token Value and create a token with a static value of 7 (or any other value, for that matter) and then use the token in the "Remove At" function, nothing happens.

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

Sign in to reply to this post.