Assigning a picture to a user depending on a users rank

Hi everyone, first time poster.

I am building an app which is dependent on the users having a rank which will be manually assigned, but defaulted to (lets call it) rank 1.

I want the ability for different ranks to have different pictures assigned to them, which will be displayed on their profile page, this will be displayed using a dynamic image, and to get that image I will use dynamic data.

Currently i have a very barebones web app which has two custom data types, Users and Ranks.
Users have fields that you would expect, with one of them being rank which has a field type of text. The other data type is rank, which has the different ranks, with images as their field type.
The dynamic data for displaying the picture on their profile is Current Users Rank. I have tried a few variations of this but cant get it to do what I want want. I have an hunch that it is something to do with Users > ranks (as a text field type), but im not sure what to change it to.

If i havent explained myself very well please ask me to elaborate.

I’m hoping to become more active on these forums as I expand my knowledge of this platform. I’ve been using bubble for a few months and am excited by the opportunities it creates.
Also, congratulations on your successful seed round.

Cheers

Chris

I’d save the users rank as a number in the DB. So whenever your rank up workflow occurs you could just simply do Current User’s rank + 1.

Then on your image element set a static picture of the first rank. Then add conditionals to that image element to change that static picture based on the user’s rank.

So your conditionals on the image element would be When Current User’s rank is 2 then show the rank 2 image, and When Current User’s rank is 3 show the rank 3 image and so forth.

No need for dynamic data unless you’re allowing your users to upload their own pictures.

Hope this helps.

3 Likes

Thanks Tim, you’ve created a really simple solution to what I made sound like a complicated problem. Using this method i can also remove the custom data type for ranks, and just run the whole thing through the conditional on the image, and the number for the rank under the user data type.

Thanks for your help, i really appreciate it.

2 Likes