
User1623760146819474772 (Customer) asked a question.
hi,
we are trying to sortby "passwordchanged" but it throws
Invalid search criteria. (400, E0000031): Invalid search attribute.
any help would be appreciated
(when sortby is "profile.firstName" all is good)
what are the valid sortby parameters?

Hello @User1623760146819474772 (Customer) Thank you for reaching out to our community.
Testing the API call {{url}}/api/v1/users?sortBy=passwordChanged eq "2018-08-27T18:55:59.000Z" works on my end. However please keep in mind that the "sortBy" expression should be used with "search" as per our documentation here:
https://developer.okta.com/docs/reference/api/users/#list-users-with-search
We have a search query which is:
(profile.roleSearchValue eq "Customer" or profile.roleSearchValue eq "Partner" or profile.roleSearchValue eq "RestrictedPartner")
(c#)
And the sortby parameter is "passwordChanged"
Could it be that it can’t sortby when some of the values are null? Is there no check?
Thanks in advance, tehila
@Paul S. (Okta, Inc.) we are using the sdk with "search" and "sortby"
_oktaClient.Users.ListUsers(after: prevPageId, limit: pageSize, search: filterStr, sortBy: sortBy, sortOrder: direction);
filterStr = (profile.roleSearchValue eq "Customer" or profile.roleSearchValue eq "Partner" or profile.roleSearchValue eq "RestrictedPartner")
when
sortBy= "passwordChanged"
(if sortBy="profile.organization" it all works great)
an error is thrown
Invalid search criteria. (400, E0000031): Invalid search attribute.
any help\suggestion would be appreciated
thanks in advance