How to store CSV data of Data loding (file) in Javascript variable?

Avatar

Avatar
Validate 1
Level 1
uz2020
Level 1

Likes

0 likes

Total Posts

32 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
uz2020
Level 1

Likes

0 likes

Total Posts

32 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
uz2020
Level 1

18-01-2021

Hello, I'm Super Beginner.

 

How to store CSV data of Data loding (file) in Javascript variable?

Or can read the CSV file directly with JavaScript?

 

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 5
Level 4
ParthaSarathy
Level 4

Likes

42 likes

Total Posts

66 posts

Correct reply

30 solutions
Top badges earned
Affirm 5
Establish
Give Back
Boost 5
Boost 3
View profile

Avatar
Affirm 5
Level 4
ParthaSarathy
Level 4

Likes

42 likes

Total Posts

66 posts

Correct reply

30 solutions
Top badges earned
Affirm 5
Establish
Give Back
Boost 5
Boost 3
View profile
ParthaSarathy
Level 4

19-01-2021

Hi @uz2020 ,

Lets say your Csv file contains 2 columns 'name' and 'email'. And internal name of your data loading (file) activity as 'fileImport'.

Next to your data loading activity, place a javaScript activity and try the below coding,

 

var query = xtk.queryDef.create(
<queryDef schema="temp:fileImport" operation="select">
<select>
<node expr="name"/>
<node expr="email"/>
</select>
</queryDef>
);
var record = query.ExecuteQuery();
for each (var variable in record) {
instance.vars.name = variable.name;
instance.vars.email= variable.email;
logInfo("Name is : "+instance.vars.name);
logInfo("Email is : "+instance.vars.email);
}
 
Regards,
ParthaSarathy S

Answers (0)