yes so my code already exists for other functions, in fact i think you helped me with some it it previously but this request for help is an addition and i thought the complete code that i’ve included might be useful
I have a field key that shows exactly what it should for the logged in owner of the key, what i would like to do is use the same field key but slice away the first 4 characters and include another field key as the text string for non-logged in users so that the text string reads properly for them
I am like J.D. here and slightly confused as well.
If the user is logged in then you can get their firstname either by use of code and display it in a text box like you have done, or you simply link a textbox to your members dataset and it will simply show the name from the firstname field of that logged in user.
However, as J.D. has already said above, if the user is not logged in, then you will not have any firstname data to use from the dataset and the value will be undefined and return nothing.
Are you creating another form that non logged in users are using before they get to this stage of showing their first name? Like if somebody contacts you through your website and they are given a contactId for example?
If it is then you would need to be explaining that to us here so that we understand your process and not make it sound like you are trying to show a logged in users firstname to a non logged in user.
Another way to do this if you don’t want them to be made as contacts on your site, is to just make use of Wix Storage API and save the firstname value and then recall it in the form that you need it on. That way you are not having to have an additional database just for this https://www.wix.com/corvid/reference/wix-storage.html
Or do you have a set default value that you want to be put in the text box if the user is not logged in and it only changes if the user is logged in?
If this is not what you are doing, then please explain more.
Thanks guys, so the only answer i can give you is that a dynamic dataset that has been pre-populated and saved before a non-logged in user arrives at this page shows all the fields that i’ve connected
the code at the top of this page shows two different columnstrips and i have placed two different text strings in those
1, One which welcomes a logged in user personally i.e. welcome Joe to Adam’s page
the other
2. for a guest i.e. welcome guest to Adam’s page (Adam being a fieldkey name and field- already in the collection)
but both show a fieldkey of first name which is fine
so on this is about using another text string but this time slicing the field and placing the code somewhere in the not logged in code section above