Setting field values from email with special characters

Ricky S Larsson
Tera Guru

I am trying to setup an inbound email action that set field values based on the email body text according to this SN article: Setting field values from the email body

How would I be able to read body text that use special characters? One example is that a Swedish user is supposed to write in their first name in the email. First name in Swedish is Förnamn (so the email would be written like Förnamn: Richard, and so on) 

if(email.body.förnamn!=undefined) {
	current.variables.first_name=email.body.förnamn;
}

That of course, doesn't work because of the special character Ö.

Do I have to tell them to write First Name instead, or is it possible to convert the special character somehow?

 

1 ACCEPTED SOLUTION

It seems to have some additional content in the body. Can you check if you are able to access its value in here when you stringify

for (var key in email.body) {
   var key = key.toString();
   var value = email.body[key].toString();
   gs.info("Key: "+key);
   gs.info("Value: "+value);
   if(key == 'The Value logged'){

   }
}

View solution in original post

7 REPLIES 7

It seems to have some additional content in the body. Can you check if you are able to access its value in here when you stringify

for (var key in email.body) {
   var key = key.toString();
   var value = email.body[key].toString();
   gs.info("Key: "+key);
   gs.info("Value: "+value);
   if(key == 'The Value logged'){

   }
}

Did that work?

Yes it did. It turned out Fornamn did work. I must have just missed something. So ÅÄÖ becomes AAO.

Thanks so much!