Transformer issue with mysql db

Hi i got the following transformer

// trMakeBulkInsertArray
let newData = [];
let items = {{}}

items.forEach(item => {
transaction_id: {{ saveTransactionID_OC.value }},
product_id: item.product_id,
variation_id: item.variation_id,
quantity: item.qty,
created_at: item.created_at,
updated_at: item.updated_at
return newData

and im getting the following error in console

but when i go {{ saveTransactionID_OC.value }} it does have a value, what im doing wrong?

Hey agaitan026!

First error points out to being null at some point. If you are using legacy table when it is empty .data can return empty string ("") instead of empty array. For each requires an array thus why causing the issue.

Second error depends on how the crearOC2 is set up so we might need a bit more insight in order to narrow it down but points to the same direction of the value being null. (Perhaps you are using transformer1.value in it?)

Hope that helps!

1 Like

yes , the issue was i tried to run two diff scripts on query (the wrong script was running first, thats why it was null) event handler on success i separate both script and it works good. thank you