Avatar

Level 4

@montezh2001,

 

Something like this would work for you :

var query = xtk.queryDef.create(
              <queryDef schema={vars.targetSchema} operation="select">
                <select>
                  <node expr="@id"/> //or any identifier of the workflow's temporary table
                  <node expr="@image1"/>
                </select>
                </queryDef>);
var results = query.ExecuteQuery();


for each( var tmp in results){
  var res = tmp.@image1.toString();
  res = res.replace(/^0+/,'');
  xtk.session.Write(<{vars.targetSchema.split(':')[1]} _operation="update" _key="@id" xtkschema={vars.targetSchema} id={tmp.@id} image1={res}/>); // update each row of your temp schema with the right res
}

No need for Enrichment after that.

 

Br,

 

Amine