javascript

shivak41694392

19-09-2016

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);
};

Accepted Solutions (0)

Answers (1)

Answers (1)

Linda_Stinson

Employee

30-09-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" ... />