Query Subject Line using querydef | Community
Skip to main content
Level 3
January 6, 2021
Question

Query Subject Line using querydef

  • January 6, 2021
  • 2 replies
  • 2845 views

Hello,

I am trying to query the BroadLog for a specific subject line using querdef. What should the javascript code/query look like? The field I am trying to query is located here:

nms:broadLogRcp/delivery/mailParameters/subject 

Thanks!

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

2 replies

kapilKochar
Level 6
January 7, 2021

<queryDef operation="select" schema="nms:broadLogRcp"  xtkschema="xtk:queryDef">
<select>
<node expr="[delivery/mailParameters/subject]"
label="Subject (Delivery/Email header parameters)"/>
</select>

<sysFilter>
<condition>fill the condition you want</condition>
</sysFilter>
</queryDef>

adithyacs86
Level 5
January 21, 2021

Hi Kapil, I have tried doing the same like below:-

 

var query = xtk.queryDef.create(
<queryDef schema="temp:enrich" operation="select">
<select>
<node expr="@deliveryID"/>
</select>
</queryDef>)

var res = query.ExecuteQuery();
for each(var element in res){

delivery = NLWS.nmsDelivery.load(element.@deliveryID)

subject = delivery.mailParameters.subject;

logInfo("delivery =" + element.@deliveryID + "Subject= " + subject);

sqlExec("update "+vars.tableName +" set ssubjectLine='"+subject+"'");

 

I can get the log Info of the deliveries of the subject line. But I am not able to load the data to the variable that I have created in the previous enrichment activity, which is the sqlExec code just after the logInfo in the above script. 

 

Requesting for an help. 

 

Thanks,

Adithya

 

Adhiyan
Adobe Employee
Adobe Employee
January 27, 2021

Hello ,

Can you please take a look at 

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic/export-subject-or-in-general-xml-field-in-export-template/td-p/293911

 

There are certain limitations while working with xml fields in QueryDef and loading the data of the subject into the variable could be a limitation.

 

--
Adhiyan