Hello aero, yes i think it is possible exept the idea with the profile-pic.
In this case i am unsure.
Example-Situation: (little Brainstorming —> how2 get what we need?)
I am a user on your site, and use a form to leave a comment. I will surely to have press aBUTTON to submit, to here we have already our event which will be the door to get what you want.
By pressing a button we can start a function:
function xxx () { } // you can name the function as you want, i am a lazy person, i just name it "xxx"
And now we wanna get our username of the current user who has created this new COMMENT (in this case its me)
So where to find this information of the user? Of course in the “PrivateMemberData”. So let’s do it…
We have now several options how to get what we want, for example by quering the database of our choice (“PrivateMemberData”) …
import wixData from 'wix-data';
wixData.query("PrivateMemberData")
.find()
.then( (results) => {
if(results.items.length > 0) {
let firstItem = results.items[0];
} else {
}
} )
.catch( (err) => {
let errorMsg = err;
} );
Now you should have all the Information of “PrivateMemberData”
When you use CONSOLE.LOG, you can visualize all the data of this data-query.
console.log (results.items.title[0])
console.log (results.items.name[0])
console.log (results.items.firstName[0])
console.log (results.items.lastName[0])
//do not know exactly if this works .....
console.log (results.items.picture[0].url)
//...or....
console.log (results.items.picture[0].link)
//..to get the url of the Profile-Pic....
The last thing is to get this function be started by a klick on a button.
export function button1_click(event) {xxx()}
And now you can look at the results in the CONSOLE.
I did not test this CODE, so i hope it will run without any errors.