Query with a special character.
Im were used the import CSV which has some records with name field contain "m²". But then i can not using the get action in API to get the records with input "m²". Wondering what is the issue and if there are some solution.
Thanks for all help.
Answers
-
Hi @Liz Anaya do you have an idea on how to solve this?
-
Hi @lpnhox and @Ben -5225939! @lpnhox Can you share what you are seeing on your end? I tried to replicate the issue, but I was successfully able to retrieve records containing the field "m²." Wondering what you are seeing on your end.
Here is what my test table looks like:
Here is my testing endpoint:
And the result:
-
Hey @lpnhox - I was just thinking about this further… is the issue that you have the "" as part of the text in your field?
So then, when you try to get the record, you get the "Please enter valid JSON" error?
If this is the case, place a backslash
\
before each"
that is intended to be part of the text.
Let me know if this helps. 😊 -
Hi @Liz Anaya I have a similar problem here. My table has a record "Québec" but if I input "Quebec", it doesn't bring anything.
Can you please help out? Thanks in advance!
-
(In time: I would be able to remedy the opposite situation, if I had "Québec" as input and "Quebec" in the table by using ".*" transformation, but this is not my issue 😫 )
-
Hey @FabianaBarril! 👋
A possible solution would be to create a conditional statement, checking if the input is either Québec or Quebec.
If this is true, then Query All Record from the Table by custom query where the field is equal to either Québec or Quebec.
This should work. 😊
-
Hi @Liz Anaya
Thank you for that but… some considerations here 😅
I need to use this condition in a filter so doesn't matter what comes in as input, it will search on my (indexed) table. I have no idea what the user will input - it's a search feature in my app.
In the example below, I have
Québec
in my table but if the user typesQuebec
, nothing happens:I would treat the input if it was the opposite, but how I can treat (all) my record(s) so the search would work, please?
-
You likely want to store and query using lowest-common-denominator. The convert_encoding filter seems like the right tool for the job, and you may have to do additional replacements as well to go from the specific UTF characters to the A-Z baseline you're looking for.
In broad strokes, you most likely want to:- Make a field that contains the ASCII versions of the other fields (lowest-common-denominator -
Québec
becomes Quebec) ) - Build your full text index on that field
- When you get a search query, strip the characters to get the ASCII version
- Use that stripped input for your search input.
- Make a field that contains the ASCII versions of the other fields (lowest-common-denominator -
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