Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

javascript

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

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