javascript | Community
Skip to main content
shivak41694392
Level 2
September 20, 2016
Solved

javascript

  • September 20, 2016
  • 1 reply
  • 1764 views

hi all,

Could you please help me with the below query ..

I am passing the values of a variable which has been derived in a workflow ,into a schema . below is the JavaScript which I have written.

however it is not working as expected ...  any ideas would be great ..

  
     
      var query = xtk.queryDef.create( 
       <queryDef schema="temp:extract" operation="select">
         <select>
                <node expr="@membership_number"/>
           <node expr="@segmentCode" />
         </select>
      
       </queryDef>
     ).ExecuteQuery();

// Get Members from Enrich list
for each ( var multimembers in query.extract ) {

       instance.vars.mem = multimembers.@membership_number;
      instance.vars.seg = multimembers.@segmentCode;
  logInfo("segment: " +   instance.vars.mem);
  logInfo("segment: " + instance.vars.seg);
 
  spec=<query xtkschema = "bupa:broadLogmembership"
            _operation = "update"
            _key = "@membership_number"
        
            CREATIVE_ID = {instance.vars.seg}
            />;

xtk.session.Write(spec);
};

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

The query appears to be written correctly. Are you getting the log messages as expected?

For the write, the xml tag should match the root element tag of the broadLogmembership schema, which I am guessing is not query but usually matches the schema name. Try writing it like this:  spec=<broadLogmembership xtkschema="bupa:broadLogmembership" _operation="update" ... />

1 reply

Linda_Stinson
Adobe Employee
Linda_StinsonAdobe EmployeeAccepted solution
Adobe Employee
September 30, 2016

The query appears to be written correctly. Are you getting the log messages as expected?

For the write, the xml tag should match the root element tag of the broadLogmembership schema, which I am guessing is not query but usually matches the schema name. Try writing it like this:  spec=<broadLogmembership xtkschema="bupa:broadLogmembership" _operation="update" ... />