Forum Discussion

keithkelly's avatar
3 years ago

Select messages where user *doesn't have* FooBar role?

Objective:  Create message list of messages posted by non-employees. 

SELECT yada, yoda 
FROM messages 
WHERE depth = 0 
  ** AND USER DOESN'T HAVE EMPLOYEE ROLE ** 
ORDER BY conversation.last_post_time LIMIT 100

 

From the LiQL reference, I don't see a constraint that will allow this.  Is this possible?

2 Replies

  • This is possible but there is no direct API for this. But there will be performance issues too if we go with other way.

  • Hi keithkelly. I tried to do something similar and was told it wasn't possible. Re: Can You Get Author Roles From A Messages Subqu... - Atlas (khoros.com)

    I ended up using rank to exclude employees, because luckily you can get author.rank as a field for a message and we happen to have employee specific ranks. I still don't think you can use that as a constraint. Under constraints all I see are author.id and author.login. It might be worth a try though.