Replacing several words in a field
Options
![JJ](https://us.v-cdn.net/6037124/user_avatars/1335010.jpg)
JJ
Member ✭
Hi,
I am trying to create an app that replaces bad words with the right word. Say "Sh*t" with "Poop" 😀
So as the example, control the swearing.
I know I can make it using a Query all records and then using an IF to replace each word, but I have 10 words to check and end up having a lot of Else Ifs.
Wondering if there is a better and more optimized way to compare the field to this list of 10 words and do a quick replace without having too many IFS ELSE. Thank you very much in advance.
I am trying to create an app that replaces bad words with the right word. Say "Sh*t" with "Poop" 😀
So as the example, control the swearing.
I know I can make it using a Query all records and then using an IF to replace each word, but I have 10 words to check and end up having a lot of Else Ifs.
Wondering if there is a better and more optimized way to compare the field to this list of 10 words and do a quick replace without having too many IFS ELSE. Thank you very much in advance.
Comments
-
You can do this by chaining together the replace filter.
https://docs.xano.com/working-with-data/data-type-filters/text-filter#replace -
Hi ,
Thanks, looking into the document, by chaining, do you mean I will add a "replace" condition 1 filter per 1 word? Thank you very much.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback