Skip to main content
Level 2
September 30, 2021
Question

Personalizing error notification using values from operation schema

Hello Team,

 

 

Is it possible to set values from campaign to the variables in a workflow notification template.

 

I am trying to generate a notification to workflow supervisor with campaign name when a campaign workflow fails.

 

Thank you.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

Manoj_Kumar
Community Advisor
Community Advisor
September 30, 2021

Hello @mpalaves 

 

You can get the campaign name in workflow with this code.

 

 var q = xtk.queryDef.create(
  <queryDef schema="xtk:workflow" operation="get">
    <select>
      <node expr="[operation/@label]" alias="@label/>    
    </select>
    <where>     
        <condition expr={"@id ="+instance.id}  /> 
    </where>
      
  </queryDef>
);
var workflow= q.ExecuteQuery();
logInfo("Operation Name is :"+workflow.@label);
Translate
Manoj  | https://themartech.pro
mpalavesAuthor
Level 2
October 1, 2021

Thank you @_manoj_kumar_  for your reply.

I am able to get the campaign name but unable to pass it to the workflow error notification template. How can I pass this extracted value to the workflow notification that is sent to the supervisors when the workflow fails.

 

Regards,

Translate
Manoj_Kumar
Community Advisor
Community Advisor
October 1, 2021

@mpalaves 

 

after this code Add this line.

 

instance.vars.campaignName=workflow.@label

Then open the delivery and in advance tab for delivery add this code.

 

delivery.variables._var[0].stringValue=instance.vars.campaignName;

Now open the delivery go to properties and under variables tab. Create a new variable with data type as string and name it campaignName;

 

Now in your delivery HTML you can use this code to print the campaign Name

<%= variables.campaignName %>

 

Translate
Manoj  | https://themartech.pro
Adobe Employee
October 7, 2021

HI There,

 

Unless I am mistaken on the request but the Alert activity allows you to get the Workflow and Campaign information via the editor itself. See below

Hope this helps,

Thanks

Denis

Translate
kapilKochar
Level 6
October 19, 2021

Hi, 

When you use supervisor notification as alert there is a link at the end which have all the details of that workflow which failed because of some error and also contains Campaign link and campaign label . If you check the source in HTML , it's using workflow.jssp 

 

<%@ include option='NmsServer_IntranetURL' %>/xtk/workflow.jssp?id=<%= dataSource.workflowId %>

 

 

 

Translate