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

Question

Question

Workflow write Multi-Value field to multi-row SQL database?

asked on June 11, 2014 Show version history

 Is it possible to have Workflow retrieve a multi value field, and then write to a SQL DB with multi row?  If it is, what would be the best route to take to achieve this?  I have tried for "each value" function, but it keeps duplicating fields when its outputting to SQL. Thanks.

 

example:

 

                                      Laserfiche                                    To                             SQL DB

 

                 Multi Field 1 : Multi Field 2 : Multi Field 3 ----> Column 1 : Column 2 : Column 3

 

Row 1:      A                    !                      Test 1                   A                 !                Test 1

Row 2:      B                    @                   Test 2                   B                 @              Test 2

 

example 2:

 

if I have 3 multi-value fields, here is how it displays:

 

Grant 1

Grant 2

Grant 3

Project 1

Project 2

Project 3

Amount 1

Amount 2

Amount 3

 

would it possible to have them output to SQL or Excel like this?  

 

Grant 1         Grant 2        Grant 3

Project 1       Project 2     Project 3

Amount 1      Amount 2    Amount 3

 

I don't think so but I thought I'd double check just in case. Thanks so much!

0 0

Answer

SELECTED ANSWER
replied on June 11, 2014

You will want to loop through the values of the tokens using a Repeat activity. 

You will loop based on the iteration count being less than or equal to the value count of the multivalued token (starting the iteration token at 1). You will then add the value from your token at the index of %(iteration) to your SQL database.

 

1 0
replied on August 13, 2014

In the example above is the %(Multi Value Token#@Count@#) literal?

 

When I try to publish it says MultiValueToken cannot be resolved.  Am I supposed to substitute the Multivalue field name?

0 0
replied on August 13, 2014

It's the token for one of the multi-value fields.

0 0

Replies

replied on June 11, 2014

Thanks Matt, your suggestion worked perfectly. yes

0 0
replied on July 17, 2014

Would it be possible to do this the other way around? I have a query that returns 21 rows. I need to move the data in each row from the query into a multi-value token. I have been trying to figure this out, but not having much luck. 

 

Thanks!

0 0
replied on July 17, 2014 Show version history

You'll want to use Assign Token Value to create a multivalue token, then use a for each row to append the values.

 

0 0
replied on July 17, 2014

Thanks Matt, We got it figured out. We're still super confused as to how it works but at least it works.

 

Ross aka Zach's Team Leader

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

Sign in to reply to this post.