Skip to main content
Aug 26, 2022 6:48 AM UTC
Solved

Campaign Internalname Using javascript function returns blank

Hi,

I am trying to retrieve my current campaign name using instance.opertaion.Internalname. But it returns blank. can you please suggest which Js function will be working for retrieving campaign internal name. Apart from Sql query function. Appreciate your prompt response.

 

Thanks,

Gokul

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ParthaSarathy
ParthaSarathyAccepted solution
Community Advisor
Aug 26, 2022 7:56 AM UTC

Hi @gokul35 ,

You can use the below JS in the campaign Workflow to retrieve the Campaign Internal Name

 

var query = xtk.queryDef.create(<queryDef schema="nms:operation" operation="select"><select><node expr="@id"/><node expr="@internalName"/></select><where><condition expr={"@id = '"+instance.operation_id+"'"}/></where></queryDef>); var eventExistss = query.ExecuteQuery(); for each (var eventT in eventExistss.operation){instance.vars.CampaignInternalName = eventT.@internalName;}

logInfo("Campaign Internal Name: "+instance.vars.CampaignInternalName);

 



 

~  ParthaSarathy S

1 reply

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
Aug 26, 2022 7:56 AM UTC

Hi @gokul35 ,

You can use the below JS in the campaign Workflow to retrieve the Campaign Internal Name

 

var query = xtk.queryDef.create(<queryDef schema="nms:operation" operation="select"><select><node expr="@id"/><node expr="@internalName"/></select><where><condition expr={"@id = '"+instance.operation_id+"'"}/></where></queryDef>); var eventExistss = query.ExecuteQuery(); for each (var eventT in eventExistss.operation){instance.vars.CampaignInternalName = eventT.@internalName;}

logInfo("Campaign Internal Name: "+instance.vars.CampaignInternalName);

 



 

Translate
~  ParthaSarathy S