Why this do ID reference does not work?

Hi all,

I am trying to obtain the email of a user to send them an email via SendGrid.

I have a KeyID in the URL (ID of the user) and I want to look in the database for that user - and detect the email address. Then, send the email using SendGrid API.

Note that the Sendgrid variable works with a normal email address - meaning that the issue is not in the API, it’s with the email variable call

Here’s an example:

In my page URL, I have this KeyID (unique for each product):
image

In my User database, I have this entry - which is the same number as the KeyID in the URL:
image

I would then like to search the correct user with the “Expert_id” in my database and send an email.

I have therefore:
image

I also tried with “each item’s email” instead of “first item’s email” but no luck.

Anyone could tell me what I am doing wrong?

Thanks in advance!

Hey @dom4 :wave:

I think type of expert_id field is not text, it is probably an Expert if you have this data type. It looks like ID in the database though. That’s why it doesn’t work maybe.

Can you verify the type of expert_id field?

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

If KeyID is same as the uniqueID autogenerated by bubble, you can directly write this
Get KeyID from url ( Type User) ' email

This is much simpler.

I would also have a look at privacy rules and see if the fields are hidden in this scenario.

Hope that helps!

Hi Flusk - thank you for your help.

I just looked and yes, the “expert_id” field is “text”:
image

I am using this variable for other functions and it works as it should - only problem is this one.

Would you have any other idea of what I can try? Thanks again

Hi Animisha,

Thank you for your suggestion. That it’s great to know - however it wouldn’t work in this case as the “expert_id” field is not the same as UniqueID.

This is because I have 2x types of users:

  • Normal users (UniqueID)
  • Experts (UniqueID and expert_id, which is the UniqueID of the users)
    Therefore if “expert_id” has a value, it means they are an exper
    Also please note that the User expert_id = Expert UniqueID

Any idea of what I can try next?

My other suggestion would be, to test printing the `Get KeyID fron Page URL to a text to see if it really works and get the keyID.

Simply, you have to check every single step by separating them.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

You were right! It was the privacy rules that was an issue.
I am new to Bubble and didn’t this was a thing. Thank you for suggesting this - it now works perfectly.

Thanks!

1 Like

Thanks Flusk.

I found the “issue” which wasn’t really an issue. It was the privacy permission that I had to change. Didn’t know it was a thing until today.

Allowed the fields to be searched and it now works well.

Thank you again for you help. Very nice of you.
Have a good day

This topic was automatically closed after 70 days. New replies are no longer allowed.