Hello,
A little request here,
Can the search bar take accents please?
For example if I write: “Chateau” I would like to see “Château” in the results list
(a = â) , (à =a), (é =e) , (è = e) , (ê =e) etc…
Thank you
Hello,
A little request here,
Can the search bar take accents please?
For example if I write: “Chateau” I would like to see “Château” in the results list
(a = â) , (à =a), (é =e) , (è = e) , (ê =e) etc…
Thank you
Hello do you have any news about this topic please? Thank you
@Phenix what’s happening now when you type words with accent ? and what Datasource are you using ?
Hello @artur ,
I use Airtable as a datasource and when I or my users write “Hotel” or “Chateau” in the search bar there are no results because the original name is “Hôtel” or “Château”
Since my initial message I made a small automation in Airtable that applies a replace on {Name} when an entry is added and puts it in a field {Search} that I use in the “Search by” of Softr
But I admit to hope for native support of accents by Softr ^^
Here the code:
let inputConfig = input.config();
let table = base.getTable("Salles");
let record = await table.selectRecordAsync(inputConfig.recordId);
function removeAccents(text) {
return text
.replace(/[àáâä]/g, "a")
.replace(/[èéêë]/g, "e")
.replace(/[ìíîï]/g, "i")
.replace(/[òóôöõ]/g, "o")
.replace(/[ùúûü]/g, "u")
.replace(/[ÀÁÂÄ]/g, "A")
.replace(/[ÈÉÊË]/g, "E")
.replace(/[ÌÍÎÏ]/g, "I")
.replace(/[ÒÓÔÖÕ]/g, "O")
.replace(/[ÙÚÛÜ]/g, "U");
}
if (record) {
let inputValue = record.getCellValue("Nom du Lieu");
if (inputValue) {
let cleanedValue = removeAccents(inputValue);
await table.updateRecordAsync(record.id, {
"Search": cleanedValue,
});
}
}
Thank you