List of values to insert

ATTENTION: This forum is no longer active. Please navigate to our new support site at https://support.starfishetl.com/
Viewing 3 posts (of 3 total)
Connel Bell
User - Author
Post count: 16
#1

I have some fields in SFDC that are effectively strings of values - the annoying multi-select lists from Salesforce. E.g. Account_Support__c = 'John Smith;Jack Brown'

I would like to parse those lists and insert them as N:N related items in Dynamics CRM online. so I would have to INSERT multiple rows for each value in the Origin data. Is it possible to do that in one stage? Could I parse that in the Origin query for SF? What type of SQL does that use?

Thanks

Comments (3)

Aron Hoekstra's picture Aron Hoekstra
Administrator
Post count: 2
#2

There is a way to do this but it would involve some scripting. Here's an overview. Basically you'll set up a single stage, parse the list into an array, and call the stage multiple times based on the array length.

I'm working on an example and will post it here shortly.

Log in to post comments
Aron Hoekstra's picture Aron Hoekstra
Administrator
Post count: 2
#3

Here are the steps to set up a basic repeated call of a stage.

  1. Dim 2 variables in the Global Include section
  2. Create a new stage, call it "Insert" (You can call it whatever you want, just remember what it is for step #5)
  3. Create a new Exec Before VBScript Procedure, making sure you choose the correct field to parse.
  4. In your stage, assign the value of the current array index to the field where you want to save the list value.
  5. Finally, create an Exec After VBScript Procedure, ensuring the GotoStage calls the stage by it's correct name, and Exec When is set to "Repeat Each Stage".

That should do it. It will repeat the call to your one stage multiple times, depending on the number of values in your array.

Attachment: 
Image icon step1.png, Image icon step2_2012-12-19.png, Image icon step3.png, Image icon step4.png, Image icon step5.png
Log in to post comments
Connel Bell's picture Connel Bell
User - Author
Post count: 16
#4

Thank you Aron.
I added the control loops for the array and a check for the stageName in the After Exec step and it works perfectly.

Brilliant! Thanks.

Log in to post comments
Viewing 3 posts (of 3 total)

Forum Login

Login or sign up for our forums to connect to the user community.

Reply

You must log in to post.

Not a Member? Register.