Hello,
I'm trying to list the data using sql query instead of aggregate but when I wrote this language filter to a query it gives me this error. What is wrong here?
Thanks
Hi @Mohamed Ramadan ,
there is really no need to make it this complicated
All you need in the import of the SQL widget is 1 import parameter LanguageId (type is language identifier)
In the flow where you use that SQL widget, pass into the LanguageId following expression
If(GetCurrentLocale()="en-US", Entities.Language.En, Entities.Language.Ar)
then in your where clause, you can have the simple condition
WHERE {NewsDetails}.[LanguageId] = @LanguageId
Dorine
Hi Mohamed Ramadan,
Can you share what is the error message? It is not visible in any of the screenshots you shared.
You can replace CASE WHEN ... END structure with the following:
WHERE (( @GetCurrentLocale = 'en-US' AND {NewsDetails}.[LanguageId] = @English ) OR ( @GetCurrentLocale <> 'en-US' AND {NewsDetails}.[LanguageId] = @Arabic ))AND {NewsDetails}.[IsDeleted] = 0
Hello Ravi,
Did you try using the sql query without Case structure?
CASE structures can be used only when there's no other alternative. It seriously impacts the performance of queries.
A bit more about efficiency comparison among bothhttps://stackoverflow.com/questions/56689364/sql-case-when-vs-where-efficiency