Forum Academy Marketplace Showcase Pricing Features

Let user select image from the website

Hello, looking for some simple logic, but can’t seem to figure it out on my own…

Basically, I want to display a repeating group of images and allow the user to click on one of the images and that would become the user’s avatar.

(That’s not the my real use case, but for the sake of simplicity let’s pretend it is)
Thank you!

Hey there @tomajx,

You could display all the images in a repeating group, then group the image element within the repeating group cells, then make it so when the group within the repeating group is clicked that image becomes the user’s profile pic. You’ll also need a condition that visually shows which image is currently selected for the user’s profile pic.

1 Like

Additionally, to clarify, retrieve the image URL of this clicked image and save it in your user database as an image of a text….

Thank you for a detailed answer, but I’m still struggling to get it working… Just to split your answer into parts:

  • Display all the images in a repeating group - done

  • Group the image element within the repeating group cells - really not sure how to do that( is it just selecting both, the image and the RG, right clicking and using "group elements in a group"?)

  • When the group within the repeating group is clicked that image becomes the user’s profile pic
    How would you do that? I have tried creating a workflow that sets the image as a custom state once clicked, and then using it in “make changes to a thing”, but how to ONLY use the image from the state IF it has been selected and no image has been uploaded through the image uploader?

Also since I’m already being spoonfed here I might also ask how do you keep the image as ‘selected’? Because in custom states I can only find ‘hovered’ and ‘pressed’ which are only temporary

Thank you!!!

Yes

Not sure how your database is setup but from the way I’m thinking about it as: make changes to current user, profile pic = current cell’s image