Forum Academy Marketplace Showcase Pricing Features

"Each item's" search

Hello,

I need to send email notification to a list of users.
The system in general gathers and rates answers and questions, so I need to notify those who gave answer to the same question. I search for users who answered same question using “Answered_by” field, get a list of users and then get a list of email addresses. This is what I suppose to do, but I cannot - the resulting list of emails is empty.
I suspect there is something wrong with using “:each item’s Created_by” to get a list of users by name and then again using “:each item’s Email”, formally everything is correct.
What am I doing wrong?

Regards,
Alex

Hi there, @alex.tkachev.odessa… the first thing I would check is privacy rules. Do you have a rule in place on the User data type? That data type has a rule on it by default (the rule is This User is Current User), and that rule could definitely be getting in the way of the search.

Best…
Mike

Thank you, Mike, but I’m afraid this is not the case. I tried removing search constraint for Users search and got it sent to all users, so it does not look like security issue. More, if I use a constraint not using “each item’s” like searching for users who set to receive this notification in yes/no field, the search returns correct list of emails. Both “Users” and “Answers” are “Publicly visible”.

Okay… just eliminating a possible culprit (and one that seems to get in the way of user searches a lot these days)… but yeah, I’m sure you’re right about the search in the constraint likely being the issue. I’m thinking you might need to use an advanced filter here… can you share a screenshot of the configuration of the Answers data type?

Sure, here its.

Just to explain further if you don’t mind.
As soon as a new answer is added I need to notify everyone who answered this question earlier. So, I take “Related_question” from the latest answer, search for all answers to this question, then list users from “Created_by” and use names list to find emails list.

Ah, okay… this is a bit more complicated than I thought. :slight_smile:

First, I wouldn’t have the Created_by text field. Instead, I would use the built-in Creator field because it is already linked to the User data type. Second, I assume you have a Question data type, so the Related_question field should be linked to that data type instead of being a text field (which you can’t change by the way, so you would have to delete that field and create a new one).

With those changes in place, it might be “easier” to piece this one together, but I will have to think about it for a bit.

Many thanks again. I will try.
By the way, how can I link a field to another type? I see I can chose type name in a field type, but how to link it to particular field? By giving it the same name in both types?

Yup, you link a field to another data type by selecting the data type in the Field type dropdown when you are creating the new field. You can name the field anything you want, but you have to select the associated data type in that dropdown.

I cannot get it. In type “Answers” I created a field called Question_text and selected “Questions” type for it. How this link works now? How data from one type gets to another?

When someone answers a question and you create a new thing in the Answers data type, part of the workflow that creates the thing needs to add the associated question into the Question_text field… and you’re not trying to display the question’s text in that field… you are simply making a “link” to a thing in the Question data type.

This is what I am doing with text fields and they are not linked. What is the use of linking? Ok, don’t mind, I’d better go read manual and stop asking primitive questions.

I don’t mind trying to answer your questions, but I was about to offer some friendly advice that if you don’t know how data types link together, you should do a search for some of the great training content that is out there and gain that knowledge. Without that knowledge, you are really going to struggle to do what you are trying to do in this thread (which is a somewhat advanced-ish thing to do, in my opinion).

The above being said, I am trying to put together an example on my end that produces your desired result, and if I get something working, I will post it so you can reference it.

Thank you very much. With 30+ years in software business I have never built applications by myself being Product Manager/Owner, Project/Relationship manager and like this. Now I want to use Bubble for MVP building and see it is doable. The manual turned useless, I will go look for some video or else.

Okay, I’ve got an example you can reference as you go.

I have a Question data type, and I have a simple Answer data type that looks like this…

With that configuration in place, the search in the To field for the Send email action in the workflow is actually a search for answers that looks like this…

What I am not showing (primarily because I have no idea how you will do it in your app) is the part of the first step of that workflow that populates the related question field with the question that is being answered. That should be pretty easy to do, though, and at that point, you have a workflow that sends an email to every user who answered the same question that the current user is answering.

Hope this helps.

Best…
Mike

Looks like a real solution. I will give it a try.
Thank you very much.

1 Like

It works!!! Thank you so much!

1 Like

I am sorry, @mikeloc , but you kindly and unwarily said you are not against answering my questions.
I did a simple and obvious thing - added one more constraint to filter out users who do not want to get these notifications and it stopped working.


The user search is simple as well:

This list of emails returns empty again.
Any ideas?