Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

FindUser Activity, bug or expected behavior

Avatar

Level 4

That activity has an output named "Results" of type int that according to the docs "stores the number of users that were found that matched the search filters".

For example, let's say you have a user named "john", and a user named "john1".  If you use the login id filter of "john" should it return a 1 or 2.  For us, it is a 2 but that does not seem like an expected behavior.

4 Replies

Avatar

Level 2

The Find User operation has two properties that can be configued in the Result section: Results and User.

The Results property stores the number of users that were found that matched the search filters while the User property stores a User object that represents the first user that matched the search filter.

In your example, both 'john' and 'john1' match the search filter of 'john' so the Results property should be 2. However, your User property should only contain the first user that matched the criteria. Whether it contains 'john' or 'john1' at this point is unclear since we don't know which one was found first.

Avatar

Level 4

Okay, thanks for the explanation.  At this point I'm obligated to ask WHY would it behave this way?

john and john1 are distinct names, so why would john as a search filter match BOTH?

The results field seems helpful if someone were trying to resolve name conflicts in different domains WHEN THE NAMES ARE IDENTICAL, but the current behavior's purpose does not seem at all useful.

Avatar

Level 10

The search filter will search for all or part of the name for the user that you want to retrieve. It will try to search for all user names that contain john.

This is just the way it's been built.

Jasmin

Avatar

Former Community Member

Right.  You can always perform your own filter on the results to remove partial matches.