Hi, i need to use the or operator in this case...
I have a SP list with 4 column.
Regionold; regionold2; regionold3; region
Region is like a state. I need to filter the user region actually in use with the new region.
For that,
1. I Check the region of the user with office365user
2- if he lives in regionold, print the value in region; if he lives in region2 print region, if he lives in region3 print region.
To test that i add a combobow with this formula
'Utilisateursd''Office365'.SearchUser({searchTerm:ComboBox1.SearchText;top:100}).Mail
then i add a dropdown control and i add ths formula
Filter(Base_region_centre_update; Region_Old Or Region_Old2 Or Region_Old3='Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName).Region
but it's not working. If i tried to filter with only Region_old it's working.
My sp looks like this
the attribut compagnyname is where are stored the user region in our AAD
I use this formula to check this
'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName
Can you help me. What am i missing ?
Thanks
Solved! Go to Solution.
Each condition in the filter needs to return true or false on its own - a column name alone does not do that. Try this version, using a With() to avoid a lot of repetition of code:
With({ aRegion: 'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName.Region};
Filter(Base_region_centre_update; aRegion = Region_Old || aRegion = Region_Old2 || aRegion = Region_Old3 || aRegion = Region)
)
I prefer to use the || notation to denote OR. This filter returns any records that have the user's region in any of those four columns. I wasn't sure how that fit into the dropdown or combobox you mentioned, but this should get you started.
Bryan
Each condition in the filter needs to return true or false on its own - a column name alone does not do that. Try this version, using a With() to avoid a lot of repetition of code:
With({ aRegion: 'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName.Region};
Filter(Base_region_centre_update; aRegion = Region_Old || aRegion = Region_Old2 || aRegion = Region_Old3 || aRegion = Region)
)
I prefer to use the || notation to denote OR. This filter returns any records that have the user's region in any of those four columns. I wasn't sure how that fit into the dropdown or combobox you mentioned, but this should get you started.
Bryan
Wahouu i'm so impressed. I didn't knew With function. It's powerful. I watched a video from shane young to learn more.
I modified the formula like this
With({aRegion:'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName};Filter(Base_region_centre_update;aRegion=Region_Old||aRegion=Region_Old2||aRegion=Region_Old3||aRegion=Region))
You forgot to remove .region after compagnyname.
It works like a charm. Thank a lot
User | Count |
---|---|
263 | |
110 | |
92 | |
55 | |
41 |