Hey,
When users create a post on my app with title, description etc, i want to provide like 4-5 gradient images they can choose between to be the background of the post, how would i go about doing this? I know i would have to upload them to my database, but how after that?
Once youāve uploaded the to your file storage, and stored a reference to them in your database, just provide some way for the user to select one (obviously how you do that depends on the UX and design you want for your users).
Once theyāve selected one, just save that to the relevant field in the database.
To elaborate on my current setup:
I have images stored in the option sets, and a data field in my āpostā data.
I also have a repeating group where all the gradients are - the repeating group is presented during the ācreate postā part.
My current issue is how do i make EACH image selectable AND make it possible for them to be added to the post-database
Well, again obviously, that depends on what youāre trying to do and the design/UX youāre trying to achieveā¦
But if was me Iād use a RG to display the images, a custom state to hold the selected one.
Obviously hard for you since you arent familiar with my current setup
, but when i make a post it ācreates a new thingā in my db. How would i get the result of the state into the ācreate a new thingsā
i figured it out, thank you! I used custom state āimageā instead of a number - made it a lot easier
1 Like
Just refer to it in the fieldā¦
i.e. if you have a custom state on the page called āSelected Imageā and a field in your database called āBackground Imageā, just set the Background Image field to Pageās Selected Image.