Hi all
I have a datacard containing a combo box (DataCardValue49) bound to the person field of a SP List.
My Items property for the combo looks like this:
Choices([@'ESC-RDadd'].SPModel)
I have set the data fields to Primary Text = Display Name, Secondary Text = Email and SearchField = DisplayName.
IsSearchable = true.
This all works OK but what I really want is to filter the People Picker so that rather than return everyone in AD, it only returns the users whose manager is the email address populated in Label30.Text.
For example, if fred.blogs@xyz.com is populated in Label30.Text then the people picker should only be populated with users who report into fred.blogs@xyz.com.
I tried this but I am getting errors from Office365Users.ManagerV2 function:
Items Propery of combo:
Filter(Office365Users.SearchUser({searchTerm: DataCardValue49.SearchText}), Label30.Text in Office365Users.ManagerV2(Mail).mail)
When I set this I get a badrequest error and strangely my customizations to the people picker are reversed, meaning the Primary Text and Search field get swapped to claims and the IsSearchable field gets set back to false.
I would appreciate any help with this.
Thanks.