Search in Groups and People

cancel
Showing results for 
Search instead for 
Did you mean: 
pdovhomilja
Partner

Search in Groups and People

Jump to solution

Hello,

i would like to know, how can i search in groups an people at once? I need to search in groups and people and sort them alphabetically.

Thanks

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: Search in Groups and People

Jump to solution

I guess you can't do this in a single REST invocation.

You need to filter groups in the first step...

{
  "query": {
    "query": "SELECT * FROM cm:authorityContainer WHERE cm:authorityName like 'GROUP_ma%'",
    "language": "cmis"
  },
  "include": "properties"
}

... and to filter users later.

{
  "query": {
    "query": "SELECT * FROM cm:person WHERE cm:userName like 'ma%'",
    "language": "cmis"
  },
  "include": "properties"
}

So you can merge the lists in your UI.

Hyland Developer Evangelist

View solution in original post

5 Replies
angelborroy
Alfresco Employee

Re: Search in Groups and People

Jump to solution
pdovhomilja
Partner

Re: Search in Groups and People

Jump to solution

I don't think so, we are using only Rest API by own backend writen in .NET Core and frontend writen in ReactJS.

angelborroy
Alfresco Employee

Re: Search in Groups and People

Jump to solution

You can try then something like this:

{
  "query": {
    "query": "select * from cm:authority",
    "language": "cmis"
  }
}
Hyland Developer Evangelist
pdovhomilja
Partner

Re: Search in Groups and People

Jump to solution

This is working and can you please help me with WHERE condition? How can i search all groups and users starting with "ma"? Thank you

Annotation 2020-04-06 152633.png

 

angelborroy
Alfresco Employee

Re: Search in Groups and People

Jump to solution

I guess you can't do this in a single REST invocation.

You need to filter groups in the first step...

{
  "query": {
    "query": "SELECT * FROM cm:authorityContainer WHERE cm:authorityName like 'GROUP_ma%'",
    "language": "cmis"
  },
  "include": "properties"
}

... and to filter users later.

{
  "query": {
    "query": "SELECT * FROM cm:person WHERE cm:userName like 'ma%'",
    "language": "cmis"
  },
  "include": "properties"
}

So you can merge the lists in your UI.

Hyland Developer Evangelist