Do a search contrain using url parameter

Hi!

I’m trying to perform a search of a thing where the constrain should be get from an URL paramenter. For some reason I get no results.

my data source settings:

https://capture.dropbox.com/wtQJ3L4KSk6fYyUI

https://capture.dropbox.com/wtQJ3L4KSk6fYyUI

my URL with the parameter:

https://capture.dropbox.com/bqQlQ8uHJEIeE3ly

the debug of my search:

https://capture.dropbox.com/LJnernRrGsizZFoj

Thank you

Hi there, @wordpresschef… first, you might as well check your privacy rules on the Task data type because privacy rules could always be a cause of a search not returning the results you are expecting. Second, what is the field type of the Organization field? Finally, it probably wouldn’t hurt to share screenshots of the Task data type and the App data tab with that data type in view.

Best…
Mike

Hi,

thank you for the answer. No, it’s not a privacy rule issue as I’m able to get results removing the constraint.

Organization is a thing related to the Task thing

Here is my task type structure:

https://capture.dropbox.com/YdFguHR2oNpzKcoA

and a task record:

https://capture.dropbox.com/qRzcTLx7zTnCNMWn

I think the problem is in your query that compares the parameter sent in the url with the ‘organization’ in the ‘task’ table.

Organization is a reference in the ‘task’ table and not just an email.

You’ll have to change your query to look in the original table for ‘organizations’, the organization that has the email address given in the URL parameter.

In this print…

https://capture.dropbox.com/wtQJ3L4KSk6fYyUI

organization = do a search for…

And then you set up a new search, which would pick ‘organization’ with the email in the url

1 Like

Thank you, it works.

1 Like

Hey Mike!

Query on this topic.

Using URL parameters as constraints in searches (in a repeating group for example) would it be the same as adding the direct value in the repeating group in terms of performance (Client Side vs. Server Side)?

Let’s say I want to search for a project, that belongs to a company, which slug is in my URL.

Using the URL as a constraint is the same as putting the slug of the company direct constraint on the repeating group?

My question is more in terms of performance. Client Side vs. Server Side.

1 Like

Interesting question… I’m curious to read the answer

Hey there, @NetoCamarano… maybe I don’t understand the question, but a constraint is a constraint, regardless of where the value for the constraint comes from. In other words, if you enter the value for the constraint directly or you get the value from a URL parameter, the search is still doing the same thing… it is hitting the server, getting the items that meet the search constraint(s), and returning those items to the client. So, in short, (and again, I might be misunderstanding the question), no, there should be no effect on performance (unlike an advanced filter that returns all of the items that meet the search criteria to the client and then applies the filter on the client side).

2 Likes

Thanks for your reply @mikeloc

I have one more question related to this.

If I use a URL parameter as a condition for a redirect, will the redirect be client side or server side?

Eg.:

If the user is not a contributor to a project and tries to access that project’s page, I want to redirect him to another page.

As I’m in a SPA application, the information about which project we’re dealing with, lives in a URL parameter ?project=uniqueID.

The action would be:
When the Page is Loaded and Get data from page URL (Project) collaborators doens’t contain current user → Redirection

Does this redirect happen server side or client side?

Knowing what happens client side and what happens server side is one of the most obscure things about Bubble.

@mikeloc The exactly workflow I’m trying to understand:

Condition:
IF:
Get Data From Page URL (Project)'project leader is not the current user or current user is not an administrator and URL parameter project is not empty and URL path is project

Then:
Redirect

The page loads quickly, so I think maybe the redirection is done at the client-side level, but I’m not sure, because I’m in a SPA application.