<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use dynamic variables in JS query def? in Adobe Campaign Classic Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460384#M15652</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;LI-USER uid="17435906"&gt;&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should look like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;queryDef schema="nms:broadLogRcp" operation="select" lineCount="1"&amp;gt;
        &amp;lt;select&amp;gt;
                      ...
        &amp;lt;/select&amp;gt;
        &amp;lt;where&amp;gt;
            &amp;lt;condition expr=&lt;FONT color="#FF0000"&gt;{&lt;/FONT&gt;"[delivery/@deliveryCode]="+del&lt;FONT color="#FF0000"&gt;}&lt;/FONT&gt;/&amp;gt;
        &amp;lt;/where&amp;gt;
                         ...
    &amp;lt;/queryDef&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2022 15:51:14 GMT</pubDate>
    <dc:creator>Amine_Abedour</dc:creator>
    <dc:date>2022-07-11T15:51:14Z</dc:date>
    <item>
      <title>Use dynamic variables in JS query def?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460373#M15651</link>
      <description>&lt;P&gt;Hi all!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am attempting to build a way to access the most recent mirrorUrl of the latest sent email from a defined array of emails. This is to display to internal stakeholders so that we can always see the latest version that was sent on a daily basis. For that I am fiddling with JS to fetch that mirrorUrl from an array of deliveryCodes.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am struggling with using the variables from my array inside the queryDef itself - Not sure if it is possible or just me who is just getting blind towards that syntax? However, hopefully someone would be able to help me out here!&lt;BR /&gt;&lt;BR /&gt;This is my code so far:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var deliveries = ["'play_can_v1_eml__all_'","'play_dow_v1_eml___'","'tv2_onb_v1_eml_2_a_'","'play_win_v3_eml_3_a.a_'"];
var mirrorUrls = [];

for each (var del in deliveries){
var querySet = "\"[delivery/@deliveryCode]=\""+del;
  var query = xtk.queryDef.create(
    &amp;lt;queryDef schema="nms:broadLogRcp" operation="select" lineCount="1"&amp;gt;
        &amp;lt;select&amp;gt;
            &amp;lt;node expr="@id"/&amp;gt;
            &amp;lt;node expr="@eventDate"/&amp;gt;
            &amp;lt;node expr="[delivery/@id]"/&amp;gt;
            &amp;lt;node expr="[delivery/@deliveryCode]"/&amp;gt;
        &amp;lt;/select&amp;gt;
        &amp;lt;where&amp;gt;
            &amp;lt;condition expr="[delivery/@deliveryCode]="+del+""/&amp;gt;
        &amp;lt;/where&amp;gt;
        &amp;lt;orderBy&amp;gt;
            &amp;lt;node expr="@eventDate" sortDesc="true"/&amp;gt;
        &amp;lt;/orderBy&amp;gt;
    &amp;lt;/queryDef&amp;gt;
    )

var res = query.ExecuteQuery()
mirrorUrls.push(nms.delivery.GetMirrorURL(del.@id, &lt;LI-USER uid="1716897" login="ID"&gt;&lt;/LI-USER&gt;));
}&lt;/LI-CODE&gt;&lt;P&gt;It gives me the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;11/07/2022 17:11:34 JST-310000 Error while compiling script 'PWKF5147/js' line 16: invalid XML tag syntax (line=' &amp;lt;condition expr=[delivery/@deliveryCode]="+del+""/&amp;gt; ' token='+del+""/&amp;gt; ').&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;So it looks like it is not able to evaluate the dynamic variable?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Hope that someone can help out here &lt;img class="lia-deferred-image lia-image-emoji" src="https://experienceleaguecommunities.adobe.com/html/@31B4D6D7B3510763F3CBB2AAB7997408/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; Thanks!&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 15:12:56 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460373#M15651</guid>
      <dc:creator>SorenDahk</dc:creator>
      <dc:date>2022-07-11T15:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use dynamic variables in JS query def?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460384#M15652</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;LI-USER uid="17435906"&gt;&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should look like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;queryDef schema="nms:broadLogRcp" operation="select" lineCount="1"&amp;gt;
        &amp;lt;select&amp;gt;
                      ...
        &amp;lt;/select&amp;gt;
        &amp;lt;where&amp;gt;
            &amp;lt;condition expr=&lt;FONT color="#FF0000"&gt;{&lt;/FONT&gt;"[delivery/@deliveryCode]="+del&lt;FONT color="#FF0000"&gt;}&lt;/FONT&gt;/&amp;gt;
        &amp;lt;/where&amp;gt;
                         ...
    &amp;lt;/queryDef&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 15:51:14 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460384#M15652</guid>
      <dc:creator>Amine_Abedour</dc:creator>
      <dc:date>2022-07-11T15:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Use dynamic variables in JS query def?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460499#M15668</link>
      <description>&lt;P&gt;&lt;LI-USER uid="11369192"&gt;&lt;/LI-USER&gt;&amp;nbsp;- That's it! Thank you so much &lt;img class="lia-deferred-image lia-image-emoji" src="https://experienceleaguecommunities.adobe.com/html/@31B4D6D7B3510763F3CBB2AAB7997408/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 07:23:37 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/use-dynamic-variables-in-js-query-def/m-p/460499#M15668</guid>
      <dc:creator>SorenDahk</dc:creator>
      <dc:date>2022-07-12T07:23:37Z</dc:date>
    </item>
  </channel>
</rss>

