Using input argument in JavaScript function

Hi everyone,

I’m trying to use the input argument of a JS function to search for some user’s properties, which are inside the database.

I have defined the function function1, whose input arguments are the ID’s of 2 users, as you can see in the picture below:

image

Then, I want to extract from the database the values of some properties for those users, and for that I do a search for the profiles that match de IDs’ that I am introducing as input arguments:

The thing is that Bubble doesn’t understand that ID1 is a variable and instead it’s looking for unique_id = ID1, so it doesn’t return anything at all.

Do you know if this is doable?

Thank you very much!

Setup the ID1 as a thing in Bubble’s database

Thank you cmarchan. Unfortunately, this doesn’t solve my issue. To implement my idea I certainly need to make Bubble read the argument of the function I defined in a JavaScript script .

Other option could be writing in JavaScript the code which allows me to read my Bubble’s database. So far I have no clue if this is possible, and what is the syntax to write such command.

Whatever I implement, needs to do a search in Bubble’s database inside a JavaScript function only taking the arguments of the function. My function can’t rely on a value defined in the database or another element of the project.

Please, can you confirm if this is possible?

I imagine that the argument comes from an input element in the UI. Say that it is called input A. If so, then use dynamically “input A’s value” in the place of ID1. Same for ID2 but using a second input B.