Of course, I don’t want to hard code my user’s email into the query, so I want to replace the email string with a parameter. However, with just that single change, and testing with the same email that was hard-coded in the first query, the 1 result no longer appears in the repeating group.
Could it have something to do with the fact that the value “account” in my SQL database is varchar but the Bubble value is “text”…? To me that still doesn’t explain why it worked fine when the value was hard-coded. Smells like a bubble-side issue to me…
This is what happens when I make the change… (I am using mySQL) I get an error from Bubble saying it’s an unknown column. To clarify, account is the column name, and the email string is the value.
Update: I was able to configure with the syntax where account = '$CURRENTUSER' , however the table still returns empty. Any help would be greatly appreciated!
With MySQL, you just put a “?” (no quotes) in place of the parameter. The list of parameters is simply the name you assign them that will be prompted in the data source when specifying in Bubble. So edit your query as follows:
select * from service_auth_linkage
inner join auth_user au
on user_id=au.id
where account=?
limit 10;
Name your parameter something descriptive, like CurrentUserEmail. Type is Text.
That should test fine. Then when specifying the data source in Bubble, it will ask you to put a value for CurrentUserEmail at which point you would add the Current User’s email.