Query with a special character.

Options

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.

Tagged:

Answers

  • Ben -5225939
    Options

    Hi @Liz Anaya do you have an idea on how to solve this?

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    Options

    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:

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    Options

    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. 😊

  • FabianaBarril
    Options

    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!

  • FabianaBarril
    Options

    (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 😫 )

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    Options

    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. 😊

  • FabianaBarril
    Options

    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 types Quebec, 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?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    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:

    1. Make a field that contains the ASCII versions of the other fields (lowest-common-denominator - Québec becomes Quebec) )
    2. Build your full text index on that field
    3. When you get a search query, strip the characters to get the ASCII version
    4. Use that stripped input for your search input.