Show content to specific users

Hello. Hope this has not been discussed before but here goes.
The idea is that when a user buys a product, I will add a link to his personal area to download the product (it has to be generated manually), by entering the link in the database associated to it’s user id.
My question is how do I get the user id from the customer name? It seems to only show that information when i am the user.

I would prefer to use the existing members area button.

As an alternative can i run code when a user completes a purchase? In that case I could store the user id in a database together with name, and i would just add the link at a later time.

Thank You

I just commented on a different thread with a different topic but similar method/approach.

Instead of ID, you should use the Email address.

Thread: https://www.wix.com/code/home/forum/community-discussion/upload-pdf-files-to-different-member-profiles

1 Like

Thank you. That works.
And regarding executing code when a purchase is made? Would save me some time if i could automatically insert some data in the database when a purchase is made.

@marcopsprata This is not natively available yet but @david-price is working on a premium tutorial/code that can make this process more efficient.

1 Like

hello @code-queen
i have the same issue regarding the specific content display to specific user.

1 )created a dataset called Docs having field’s (Title, Image, SampleText and Login Email (with same field name and fieldvalue as that of wix member ) using as reference field to connect Docs dataset and privatemember dataset).

  1. having two users in database A and B ,after publishing the site while login with the user A the data is displayed from Doc dataset .
    Also while login from user B t he same content is been displayed to both the users ,
    they are not getting their respective data based on their refernce field.

  2. how ? to display each user their respective data based on the email id in the user dashboard/user page.