Skip to main content

So I have a zap setup to take orders from Shopify and send to square. I have a formater working as i need the dollar to multiply by 100 to move the decimal.  It works perfect with orders with 1 item. But if an order has more than 1 item it fails saying “The app returned "Invalid Syntax: Only numeric values are allowed".”

 

Any help on how to get orders with multiple items .

 

Im using Line Item Price for they price of each item.

 

 

Hi @cdagesse

Good question.

You’ll have to use a Code step: https://zapier.com/apps/code/help

 

let Price = inputData.Price.split(",");

Price = multiplyBy100(Price);

function multiplyBy100(numbers) {
var multipliedArray = ]; // Create an empty array to store the multiplied values

// Iterate over each element in the input array
for (var i = 0; i < numbers.length; i++) {
multipliedArray.push(numbersei] * 100); // Multiply each element by 100 and add it to the multiplied array
}

return multipliedArray; // Return the resulting array with multiplied values
}

output = {Price}];

 

 


Hi there, @cdagesse! I just wanted to check in to see how you got on. Were you able to get this working using a Code by Zapier action instead as Troy suggested?

Let us know if you’re still in need of some help with this! 🙂


Reply