I’m displaying a collection (of chat messages) from Xano, and want to style the text differently depending on user_id. ie. If the user_id of the message is equal to my auth ID, it will be my primary color. If not it will be a different color. Try as I might, I haven’t been able to get it to work. It’s displaying both messages as orange, even though one of the messages has my user_id and should be blue. Can anyone tell from the attached image what I’m doing wrong?
Can you show the values of each compared value where you expect them to match?
Is one a string (T) value and another a numeric (#) value by any chance?
the chat message user_id field is an integer, and the xano user auth is an integer. only the reply should be blue because the reply was created by me (user._id 1). The first message was created by user 2 so te two messages should be different colors.
and the second message was created by me (user_id 1)h
Based on the screenshot I think you may be passing the entire Xano user auth object instead of just the id.
Thanks Matthew - that was indeed the problem.
2 Likes