I am having challenge do a specific query; hoping you can help…
Here is the psuedo code for the data tables and relationships i’m trying to establish…
- User (using bubble’s default here, I’ve not customized any attributes)
- offerRecipient (table that details people who receive offers, in addition to basic text fields, I have a User type field called "
")
- offer (this table has ‘offerName,’ ‘offerDetails’ as text fields and ‘offerRecipient’ as a offerRecipient data type)
Now, on the application side of things, I’m simply trying to show a loggedIn users all of the offers (offer table records) that belong to them.
I’m using a repeartingGroup and have not been able to get the data source and queries to return the results. Essentially can figure out how to query using the “current User” user data type on the ‘offer.offerRecipient.RecipientUser’ data point
Am I approoaching this incorrectly? Thanks for the help!
Might need more info but at first glance I don’t see the connection from the User object (current User) to the Recipient User. I do see the connection when starting at the Offer.
with this current set up, you would do Offer Recipient is in (do a search for Offer Recipients where Recipient User = Current User)
You could further refine that list based on the other fields you might have.
Not sure if you want to keep that set up but it would work for now. It’s not efficient and if your Offer Recipient object also contains a reference to the Offer in question, just search that data type and return the unique list of Offers
@hi.luisacosta, thank you for the response.
In offerRecipient table, i have a user type field called RecipientUser, which is where the user is linked.
The reason I went with this approach, is that an offer can be generated and sent to a recipient before the offerRecipient becomes a user of the system. My thought was that an admin will send offers to a known person (offerRecipient) and, if the offerRecipient, who can look at their offer with a basic search for a given offerID… Should that user determine they want to accept the offer, she would then go through the process of setting up a User and I would populate ‘offerRecipient.RecipientUser’ field with that established user.
I adjusted to store the offerRecipient.UniqueID on the offer (a recipient can have multiple offers) and will perform a similar query approach you prescribed but will do search on the more basic attribute of the string.
Thanks again for the response!