Variables in File Name | Community
Skip to main content
alistairk396804
Level 3
Feb 20, 2017 2:31 PM UTC
Solved

Variables in File Name

Hi,

I'm extracting a file and would like to include the campaign name in the filename.

<%= instance.label %> gives me the workflow name. This works perfectly.

In the script drop down I'm given the option to navigate to the Campaign level and select the following '<%= instance.operation.label %>', however on extract this supplies a blank and populates the filename with nothing.

I have the Campaign Name in the target data in the transition prior to the data extract. Can I use this? If so how?

 

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
vraghav
vraghavAccepted solution
Employee
Feb 23, 2017 8:54 PM UTC

Hi Alistair,

Even I'm finding it strange that instance.operation.label is not fetching the correct details.I'll check more on this with product engineers.

However, I do have a workaround available for your problem.

  1. Inside the file export activity, on the advanced tab there is an Initialization Script section.
  2. I'll create a variable that will hold the campaign label.
  3. To fetch campaign label, fire a SQL query on database and get the result immediately.

Code to use in Initialization script will be 

var myQuery = "SELECT O1.sLabel "; myQuery = myQuery + "FROM XtkWorkflow W0 JOIN NmsOperation O1 "; myQuery = myQuery + "ON (O1.iOperationId = W0.iOperationId) "; myQuery = myQuery + "WHERE W0.iWorkflowId = " + instance.id; vars.fName = sqlGetString(myQuery) + ".csv";

 

Attached is the snapshot of my test setup for reference. 

Hope this helps.

Regards,

Vipul

9 replies

New Participant
Feb 18, 2020 5:04 AM UTC

@vraghav Hi Vipul, instance.operation.label still doesn't work. 

Do we have any update or alternate to above question?

Translate
kapilKochar
Level 6
Aug 12, 2019 6:36 AM UTC

Any update on this one? Adobe Campaign Classic​

Translate
Level 2
Jun 16, 2019 9:44 PM UTC

Hi Vipul, can you drop the NEO adobe jira ticket ID for this please?  Thanks a lot.

Translate
Level 2
May 10, 2019 12:45 PM UTC

Hi Vipul,

This issue still appears to be open as of 8931:  Could you provide the adobe Jira ticket number and any update on it?

Thanks very much !

Translate
james_icf
Level 2
Apr 3, 2018 9:43 PM UTC

Vipul, was there ever any feedback on this?

Translate
vraghav
Employee
Mar 1, 2017 3:18 PM UTC

alistairk39680404 wrote...

Hi Vipul,

Just wondering if you had any luck with the product engineers regarding that fact that <%= instance.operation.label %> is returning a null or undefined value from within a campaign?

Thanks!

 

Hi Alistair,

This has been logged with Engineering but it might take some time to get an answer for it. Will keep this thread updated.

Regards,

Vipul

Translate
alistairk396804
Level 3
Mar 1, 2017 11:39 AM UTC

Hi Vipul,

Just wondering if you had any luck with the product engineers regarding that fact that <%= instance.operation.label %> is returning a null or undefined value from within a campaign?

Thanks!

Translate
vraghav
vraghavAccepted solution
Employee
Feb 23, 2017 8:54 PM UTC

Hi Alistair,

Even I'm finding it strange that instance.operation.label is not fetching the correct details.I'll check more on this with product engineers.

However, I do have a workaround available for your problem.

  1. Inside the file export activity, on the advanced tab there is an Initialization Script section.
  2. I'll create a variable that will hold the campaign label.
  3. To fetch campaign label, fire a SQL query on database and get the result immediately.

Code to use in Initialization script will be 

var myQuery = "SELECT O1.sLabel "; myQuery = myQuery + "FROM XtkWorkflow W0 JOIN NmsOperation O1 "; myQuery = myQuery + "ON (O1.iOperationId = W0.iOperationId) "; myQuery = myQuery + "WHERE W0.iWorkflowId = " + instance.id; vars.fName = sqlGetString(myQuery) + ".csv";

 

Attached is the snapshot of my test setup for reference. 

Hope this helps.

Regards,

Vipul

Translate
alistairk396804
Level 3
Feb 21, 2017 11:34 AM UTC

For some reason when creating using the instance.operation.label I am returning a null value which is confusing as the Campaign this workflow in running in has a populated label.

So I'm trying a new approach.

How do I replace the hardcoded text with a field held in my target data?

instance.vars.AKTEST = "Campaign Name"

I want to replace "Campaign Name" with the field @campaignLabel which I have appended in a previous enrichment.

Translate