Database "change search of field" issue

Hey guys,

I’m having an issue here with my database.
On my website, I want to display all the offers created by users.
Here’s my database.

The thing is, when I go to my database and I set a search of fiels, I have to select only one element from that same field.
Exemple :

Here I want to display the picture of the seller and also his name. But it sets the search of fields to name in the Name field and also in the Picture field.

I hope my issue is understandable. It’s quite complicated for me to explain it.

Hi @oscar.guinze

It seems like you made a couple of errors in setting up the nature of the fields.

For the picture, instead of text, you should choose “image”

Also, I suggest not creating another seller data type and instead just add those fields (Name and Email) in the user data type since your users would still be the one who would create an offer anyway. You could just display the picture and name of the seller by referencing to the user’s name and picture

Hope this helps!

Nino,

Hi @ntabs,

Thanks for your help !
I get what you mean. The thing is, I would like to group everything because, once a create a repeating group, I can only select one type of content.
This means that I can’t search for users and also search for offers.

For example, in my repeating group I want to display as such :

  • The name of the seller
  • His picture
  • His location
  • The title of the offer
  • The description

The first 2 are in my User’s database.
The last 2 are in my offer database.

3

Then I guess you could merge these fields in to one data type.

I see that you’re already doing it but it seems that the field type is incorrect.
image

Instead of referencing to the seller for the seller's name, seller's picture, and seller's email Change the field type to be text and image.

These fields, however, won’t update automatically when, say, the seller updates his email, name, or picture. To get around this, you could use Database triggers but that would be very unoptimized at scale since you would need to search for all offers related to that user.

Your current offer data type structure can already work. You just need to reference to the seller’s data like

“offer’s seller’s email”

I still suggest you do this though. You could just attach the user data type to the offer

Yes ! this is exactly what I mean.

If the user decides to change his name or picture, it won’t automatically update in the database.
This is why I’m trying to link all the database. I guess it’s not the most effective way of doing it.

The second thing, as you mentioned, is “not creating a seller data type”. I totally agree using user data would be more relevant. But in my offer database I wouldn’t be able to print User’s name and User’s email or User’s picture. I have to make a choice.

You most certainly can! You just need to reference to these data types / fields properly :grinning_face_with_smiling_eyes:

Yes but how ?

6

These are all the fields in my data type “Offers”.
The fields type are User, because I want to get the data from the User database.
It’s seems logical to me

But in my offer database I wouldn’t be able to print User’s name and User’s email or User’s picture. I have to make a choice.

When I want to define primary display fields, I have to make a choice on what I want to display. That’s where I’m lost
I want to display a picture and a nickname, but I only have the email adress printing

You see right above the issue.