javascript

Avatar

Avatar
Validate 1
Level 2
shivak41694392
Level 2

Likes

3 likes

Total Posts

20 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
shivak41694392
Level 2

Likes

3 likes

Total Posts

20 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
shivak41694392
Level 2

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)

Avatar

Avatar
Validate 1
Employee
Linda_Stinson
Employee

Likes

51 likes

Total Posts

250 posts

Correct reply

77 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 20
Ignite 10
View profile

Avatar
Validate 1
Employee
Linda_Stinson
Employee

Likes

51 likes

Total Posts

250 posts

Correct reply

77 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 20
Ignite 10
View profile
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" ... />