Forum Discussion
Sharepoint (online) search query - get properties of "people" field
Hi Mike,
Could you try adding 'OWSUSER' after the property?
Like 'PersonNameOWSUSER'. There should be such a property created in crawled properties.
The result should contain:
user.name@contoso.com | User Name | [long identity] i:0#.f|membership|user.name@contoso.com
Anyway, it's better to check for managed and crawled properties, with your people picker field name, in CA (https://contoso-admin.sharepoint.com/_layouts/15/searchadmin/ta_listcrawledproperties.aspx?level=tenant) and try the guys which will be there.
--
Andrew
- Mike JansenFeb 20, 2017Iron Contributor
Andrew Koltyakov wrote:Hi Mike,
Could you try adding 'OWSUSER' after the property?
Like 'PersonNameOWSUSER'. There should be such a property created in crawled properties.
The result should contain:
user.name@contoso.com | User Name | [long identity] i:0#.f|membership|user.name@contoso.com
Anyway, it's better to check for managed and crawled properties, with your people picker field name, in CA (https://contoso-admin.sharepoint.com/_layouts/15/searchadmin/ta_listcrawledproperties.aspx?level=tenant) and try the guys which will be there.
--
Andrew
The OWSUSER option indeed works. It returns:
user.name@contoso.com | User Name | [long identity] i:0#.f|membership|user.name@contoso.com
That's one step forward. However, I use this query in powerBI to transfor the results to a table. But I only need the username. So how can I extract the username out of this string in PowerBI query editor?
- Mike JansenFeb 20, 2017Iron Contributor
Almost there ;-)
I used the split function to get the username (split on the first "@" from the left).
So that gives me "joe.doe"
Now I want to compare that with de current user (function username()). This gives me "domain\joe.doe". So I need to remove "domain\" in order to compare the two fields.
I'll try to find a solution for that issue as well.
Meawhile, all suggestions are appreciated.
- Dean_GrossFeb 20, 2017Silver Contributor
The Search Query tool at https://sp2013searchtool.codeplex.com/ can help you learn about the different attributes to optimize queries.
Mikael Svenson is a search guru who may be able to offer some tips.