Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Access data from data loading file activity

Avatar

Level 1

Hi, I want to access data from data loading file activity which contains csv file uploaded (i.e firstName) and access that target data to email delivery and update it into some another schema

4 Replies

Avatar

Community Advisor

Hello @prachi1 

 

You can use the data loading activity and then the enrichment activity.

In the enrichment activity, you can add the first name column in additional data and use it in delivery.

Avatar

Level 1

Hi Manoj_Kumar 

Thanks for suggestions , but also I want to access that target data in JavaScript so how can I use that target data in JavaScript code and will hold target data in variable and use that variable in delivery.

Avatar

Community Advisor

Hello @prachi1 

 

You can get the data by queryDef

 

Here is a sample code:

var query = xtk.queryDef.create(
  <queryDef schema="{vars.targetSchema}" operation="select">
    <select>
      <node expr="@internalName"/>
    </select>
  </queryDef>
)

var res = query.ExecuteQuery()

for each (var w in res.workflow)
  logInfo(w.@internalName)

vars.targetSchema will give you the temporary table generated by the previous activity.

Avatar

Employee Advisor

Hi @prachi1 

Out of interest, why would you use a variable (which I suppose is a workflow variable) in the delivery when you can also use  targetData element in the delivery too? Is the variable a kind of aggregates that you'd like to calculate for multiple recipients. Do you require some formatting of the first name in the email? I would use a Personalisation Block to do any formatting in email.

 I would try to avoid JavaScript activities in workflow if other means are available. Could you elaborate the underlying requirement?

Thanks

Denis