Forum Documentation Showcase Pricing Learn more

Display data in Profile Page:Data to display should be a User but right now it is a List of Users error

I am getting an error (issue) that’s telling me: Display data in Profile Page:Data to display should be a User but right now it is a List of Users. It is not clear to me why that’s a list of users instead of a single user? I’m filtering by username. I’ve also tried filtering by user email and it still gave me the same error

So I guess the issue checker isn’t wrong.
have you set the :first item or :last item at the end of your query, which may return a list of element right now.

So I added the :first item and the issue went away. I’m not convinced that it’s working correctly yet, so I’ll play with it some more and then follow up here if need be. It’s not clear to me though why I would need to add :first item? I feel like that I should be getting back a single user and not a list of users as it indicates I am. Perhaps there’s something else I did incorrectly? Thanks for the help.

The result of a search is (almost) always a list, no matter how much you know the data will only return a single row.

Just because it returns one row, doesn’t turn it into a single object, just a list of one object. Annoying at times.

As you have found, the way round this is to add :firstitem but that is a bit of a fudge. Worth having a think about where the thing you want to display is referenced, and link from there (e.g. a repeating group). Can you send the thing to the page ?

2 Likes