<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Help with search method of UserLocalServiceUtil</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121304838" />
  <subtitle>Help with search method of UserLocalServiceUtil</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121304838</id>
  <updated>2026-04-05T23:59:18Z</updated>
  <dc:date>2026-04-05T23:59:18Z</dc:date>
  <entry>
    <title>Help with search method of UserLocalServiceUtil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121304837" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121304837</id>
    <updated>2021-12-21T14:18:59Z</updated>
    <published>2021-12-21T12:22:05Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am trying to make a custom portlet which search users in function
  of expando values and first name.&lt;/p&gt;
&lt;p&gt;I am trying with this&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;Hits hits = UserLocalServiceUtil.search(themeDisplay.getCompanyId(), 
				firstname, 
				null,
				lastname, 
				&amp;quot;&amp;quot;, 
				&amp;quot;&amp;quot;, 
				WorkflowConstants.STATUS_APPROVED, // active or approved
				params, 
				true, // andSearch 
				0, 
				UserLocalServiceUtil.getUsersCount(), 
				SortFactoryUtil.getSort(User.class, &amp;quot;orderByCol&amp;quot;, &amp;quot;orderByType&amp;quot;));
		&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where params are something like this:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;{userExpandoAttributes=true, searchExpando=[[userArea, 22]]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and userArea is a custom field. But this doesn´t work. &lt;/p&gt;
&lt;p&gt;Anyone can help me? Any help would be appreciated&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2021-12-21T12:22:05Z</dc:date>
  </entry>
</feed>
