That is a pretty old version of n8n now, Could be worth planning an upgrade at some point. Looking at your node you are not actually passing the string into the function so you would have to loop the items going into the Function node then calling your function passing in the data and returning it.
The below workflow has an example of that for you, The quick version is at the bottom of your Function node add…
// Loop items and run the function
for(item of items) {
item.json.str = removeVietnameseTones(item.json.str);
}
// return data
return items;
Thank you, it’s working now, I’ll find out to upgrade my n8n. I have some trouble when update to new version with user management. I’ve upgraded to 0.168.0 ok, but when upgrade to 0.195.0 has “user management and credential sharing for our Cloud platform” feature, my n8n site has some trouble. I’ll figure it and upgrade. Thanks.