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

Question

Question

Custom Query with Multi-value field

asked on August 20, 2015

Hi everyone,

 

Need some assistance please!  I was able to find this discussion and it's definitely close to what I'm looking for, but I need to close a few gaps.

https://answers.laserfiche.com/questions/70305/For-Each-Row-Not-Completing-First-Iteration

 

  • Have a field with multiple account numbers
  • Have a custom query that doesn't appear to be written correctly to check all account numbers OR they forgot to include the "each row" piece to make sure everything was evaluated.
  • Need to confirm that each account number entered is a valid account number
  • If it's not, I would "like" to add a text box/post it note/highlight the field with the error.  They can enter up to 50 account numbers and it would be horrible to figure out which one was wrong with nothing to reference.

 

SQL is not my strongest suit, but pictures are really helpful for me:-)  I've attached the current query and "think" I'm going to need to do a Repeat or For each Row activity to ensure that all account numbers are checked before moving on in the workflow.

Any help is appreciated.

 

Thanks!

Toyia

0 0

Answer

SELECTED ANSWER
replied on September 21, 2015

I want to thank everyone for their help on this one!!  Everything finally sank in:-)  I've attached my solution with descriptions for people in my shoes that need everything in black and white!

 

Toyia

Solution.docx (39.88 KB)
0 0

Replies

replied on August 21, 2015 Show version history

You could probably do something like the following:

 

Do a retrieve field values and get the account numbers.  

Then do a For Each Value for the retrieved account number.  Do your custom query but for the Value do a %(ForEachValue_CurrentValue).

Then do a routing decision if the Custom Query results = true or false.  

The True branch should do nothing since the account number is there.  

The False branch should put that number in an annotation.  Since you probably do not want to overwrite your other annotations, maybe create a token at the start called "Bad Numbers".  Then update that token with the current account number if false.

Then at the end, do something like a Add Sticky Note, the text of which is the value of the token (which should be all your bad account numbers).

Edit*  Not going to change the picture but you probably want to add one more routing decision at the end outside the For Each Value.  Since you do not want to add the sticky note to the document if all the account numbers are valid.  Maybe do another routing decision saying "if the Token for bad account numbers is empty do nothing" but "if the Token for bad account numbers is not empty then put the annotation".

0 0
replied on August 21, 2015 Show version history

0 0
replied on August 21, 2015

Hi Chris :-)

Thanks for the info and pictures!!  I'll give this a try and let you know how it works.

 

Toyia

0 0
replied on September 10, 2015

Ok - this seriously isn't making sense to me... ARGGGGHHHH!  I've read and re-read your post and researched others.  I'm pretty sure we're updated so it's not the bug people were talking about. 

 

I've got the retrieve field values working and the count is consistently right - if there are 4 numbers entered, it realizes there are numbers.  It will not go through the list of the account numbers though and check each one for validity.  The true/false piece works for the first number and the sticky note kind of works.  I think it will work fine once I figure out what the heck is wrong with the query and why it won't check all numbers.

 

Thanks!

0 0
replied on September 11, 2015

I thought a picture of the track tokens output would be helpful to anyone else that might be able to offer input.  Please see attached. 

 

Thanks!

0 0
replied on September 16, 2015

Wow, that is a lot of retrieving values smiley I can't tell from your screenshot if you modified your query to use the For Each Value token instead of the one from Retrieve Field Values like Chris suggested. Multi-value tokens used in single value operations always use the first value. Your screenshot shows the first iteration only, so it's not possible to tell if the query is setup correctly or not.

0 0
replied on September 16, 2015

I just don't know anymore either :-)  I attached another word doc with the description showing.  Thank you!

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

Sign in to reply to this post.