Hi,
I am looking for a solution to update a record through a workflow (only to be kept in the workflow for later usage for export).
I am working on Adobe Campaign Classic v7 build 8797
So far I have been looking around and found a solution there is working (for someone else) on Standard.
I've tried to change it to the data I want to update but without luck.
This is the content of my JS
var schemaName = vars.targetSchema.substr(vars.targetSchema.indexOf(":") + 1);
logInfo(schemaName);
logInfo(vars.targetSchema);
var query = xtk.queryDef.create(
<queryDef schema={vars.targetSchema} operation="select">
<select>
<node expr="@id"/>
<node expr="@ProductDate"/>
</select>
</queryDef>
);
var resultSet = query.ExecuteQuery();
var collection = <{schemaName}-collection _operation="update" xtkschema={vars.targetSchema}/>;
for each (var row in resultSet) {
var ProductDate = formatDate(row.@ProductDate, "%2D%2M%4Y");
var schemaNameProgram = <{schemaName}-collection id={row.@id} ProductDate='ProductDate' _key='@id' xtkschema={vars.targetSchema}/>;
collection.appendChild(schemaNameProgram);
logInfo(ProductDate);
}
xtk.session.WriteCollection(collection);
Without any change I get this error
JST-310000 Error while compiling script 'WKF963/js' line 17: invalid XML tag syntax (line='var collection = <{schemaName}-collection _operation="update" xtkschema={vars.targetSchema}/>; ' token='-collection _operation="update" xtkschema={vars.targetSchema}/>; ').
SCR-160032 JavaScript: error while compiling script 'WKF963/js'.
When changing the {schemaName} to match my schema in the flow it runs without errors but does not update the record as expected.
Thanks in advance,
Best, Jonas
Jean-Serge Biron Amit_Kumar florentlb Adhiyan