Using Regex to replace special characters with US English alphabetical charactres

Just to add to this topic, since I’ve been struggling with this myself.
I have created a plugin to do just that kind of diacritics replacement (which is free, by the way), but I’m facing a scenario where a server side action is not available.

Basically I’m inside a repeating group, in a need to grab a dropdown value as it changes and remove diacritics of it to pass to another dropdown do a API call using that value.

The solution I’ve got is using the Toolbox Plugin to run a javascript function.

Just add a “Expression” element and add the following function to it:

const removeAccents = str =>
  str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');

removeAccents('[your field here]');

Screenshot 2024-02-27 at 09.59.11

You’ll the be able to get this element’s value to use wherever you need in your app.

1 Like