Hello everybody,
i normally used the function below to get the user email in the code but recently an error appear during the test mode(e.text is not a function).
T
he wix support team told me that the API WIX USER is deprecated and i have to get the user email by using the Get email function in the API WIX MEMBER.
Can anybody help me to change my code in the updated version? thank you very much
$w . onReady ( function () {
let user = wixUsers . currentUser ;
let userid = user . id ;
I get help to made this function since the corvid years.
Yes i had a look in wix-memberr-api and seems that i have to use getemail function but i have some difficulty to build the code.
With that function i should get the email of the logged in user and if is not present in the dataset the button have to be shown.
Be patient but i am not an expert in coding, i am still learnig😊
Not excactly….i would like to
keep the logged in email
Query my dataset if his email is inside my dataset
If its present hode a button
If its not present show a button
Did i call it database?
No no it a dataset/collection
The final idea is that
If the logged in user is present in the dataset the button is hided.
If the logged in user is not present in the dataset the button is shown
the onclick function of this button will create a new item in the dataset( with the email)
What is a database?
A database is = Collection and Collection is = database.
You store all your items inside your database in different database-fields (rows and columns) like on an microsoft’s excel-sheet.
What is a -->DATASET<-- ???
A dataset is some kind of a connection (wire) between the databse and a displaying element, like —> REPEATER, TABLE, GALLERY, HTML-COMPONENT, TEXT-BOX and so on…
In your code you don’t have any codeline, which is related to a dataset.
Copy and paste my provided code onto your page.
Publish your website.
Run the code, by logging in onto your website and opening the related page, where you placed the code.
Press F12 on your keyboard, while you are in your Webbrowser (google-chrome).
Navigate to —> CONSOLE !
Take a look onto the given results → you will understand the rest.
YEAHHHHH
Seems working and the error is disappear…I just made these corrections and added the function to insert an Item if the user is not present in the Collection.
can you please tell me if i made good?