Hello,
I'm attempting to add a radio control to my filter. Everything was working until I added the radio control
the onchange property of the control has this code:
If(Radio_Storetype.Selected.Value = "COR",Set(ThisType,"COR"),If(Radio_Storetype.Selected.Value = "LP3",Set(ThisType,"LP3")))
the item property of the gallery has this code
Filter(HIERARCHY,(CM_Email=vCurrentUser.Email) && (StartsWith(StoreType,ThisType) && StartsWith(Store_id,TextSearchBox_1.Text) || StartsWith(STORE_NAME, TextSearchBox_1.Text) || StartsWith(CITY, TextSearchBox_1.Text)) )
When I play the app and change the radio, The gallery does not filter , it just shows all storetypes (COR and LP3)
What am I doing wrong?
Thanks
Solved! Go to Solution.
Hi @Sjj9166 ,
Can you share more details with your logical judgement condition?
From your current logic statement, Items would be displayed whenever the following three criteria are met, so that result is not entirely up to StoreType.
1. (CM_Email=vCurrentUser.Email) && (StartsWith(StoreType,ThisType) && StartsWith(Store_id,TextSearchBox_1.Text)
2. StartsWith(STORE_NAME, TextSearchBox_1.Text)
3. StartsWith(CITY, TextSearchBox_1.Text)
Please note the order of judgment of the logical operators, && 's priority is higher than OR
you should modify your formulas as below:
Filter(HIERARCHY,(CM_Email=vCurrentUser.Email) && (StartsWith(StoreType,ThisType) && (StartsWith(Store_id,TextSearchBox_1.Text) || StartsWith(STORE_NAME, TextSearchBox_1.Text) || StartsWith(CITY, TextSearchBox_1.Text)) ))
Best regards,
Sik
If I understand the issue correctly I think it can be fixed by making a small change to the operator precedence.
Try this:
Filter(HIERARCHY,(CM_Email=vCurrentUser.Email) && (StartsWith(StoreType,ThisType) && (StartsWith(Store_id,TextSearchBox_1.Text) || StartsWith(STORE_NAME, TextSearchBox_1.Text) || StartsWith(CITY, TextSearchBox_1.Text))) )
Hi @Sjj9166 ,
Can you share more details with your logical judgement condition?
From your current logic statement, Items would be displayed whenever the following three criteria are met, so that result is not entirely up to StoreType.
1. (CM_Email=vCurrentUser.Email) && (StartsWith(StoreType,ThisType) && StartsWith(Store_id,TextSearchBox_1.Text)
2. StartsWith(STORE_NAME, TextSearchBox_1.Text)
3. StartsWith(CITY, TextSearchBox_1.Text)
Please note the order of judgment of the logical operators, && 's priority is higher than OR
you should modify your formulas as below:
Filter(HIERARCHY,(CM_Email=vCurrentUser.Email) && (StartsWith(StoreType,ThisType) && (StartsWith(Store_id,TextSearchBox_1.Text) || StartsWith(STORE_NAME, TextSearchBox_1.Text) || StartsWith(CITY, TextSearchBox_1.Text)) ))
Best regards,
Sik
User | Count |
---|---|
140 | |
138 | |
77 | |
76 | |
69 |
User | Count |
---|---|
224 | |
184 | |
68 | |
64 | |
57 |