AnsweredAssumed Answered

How to get multi column seed file data in array in JS?

Question asked by Sunil Patel on Aug 18, 2017
Latest reply on Aug 31, 2017 by Sunil Patel

Hi There,

 

I want to get value in a array when we have seed file with multiple columns in Javascript.
Scenario :

 

Seed file example:

Barcodes             SKUs
M124334AF24S1
M124335AF24S2
M124336AF24S3
M124337AF24S4
M124338AF24S5
M124339AF24S6
M124340AF24S7
M124341AF24S8
M124342AF24S9
M124343AF24S10
M124344AF24S11
M124345AF24S12
M124346AF24S13
M124347AF24S14
M124348AF24S15
M124349AF24S16
M124350AF24S17
M124351AF24S18
M124352AF24S19
M124353AF24S20

 

My JS Snippet example :

 

var barcode  = new Array();
var sku = new Array();

// Barcodes_Skus is the property that have seed file with two columns. and Row Count set to 5 ( to get the 5 rows at a time)

barcode = $prop.value("MessageClip","Barcodes_Skus.Barcodes");
sku = $prop.value("MessageClip","Barcodes_Skus.SKUs");

// after this logic to use this data in for loop

 

If i run this script than i am getting error saying that : "Runtime error at Script line 21, column 0: Attempt to reference a struct field when the Property value is not a struct, Property "Barcodes_Barcodes" of Clip "004_KS_Order_Master_API_QA_V3", Track "Track 1", Band "Band 1"."

 

 

For above seed file i want to fetch 5 rows at a time from both columns. Can anyone help in how i can do in JS snippet.

 

However, i am able to get the 5 rows at a time as a array when seed file have only one column but it is not working with multi columns.

 

Appreciated Your time.

Thank you

Outcomes