OriginalPostID-83588
Discussion posts and replies are publicly visible
Hello Dhavals,
You can use -
user(loggedInUser(), "username") - to get the user name of the current logged in user.
user(loggedInUser(), "firstName") - to get the firstName of the current logged in user.
Thanks You
Bibhuti
These functions gives the email instead of the username
siramsuryakumar said:These functions gives the email instead of the username
This is not correct. What leads you to believe this?
username is not working only firstname is working
username returning the email id itself
Hi Richa, what were you expecting for username?. username can be email id. we often keep email Id as username and it totally depends how a user was created. You can check any user's username in Designer also just to verify whether you are getting correct userName or not.
Hi,
I am trying to get a username or email anything so I used loggedInUser() under display value in interface and choose a rule input to save it to data type which inturn is linked to a db, but when I submit form the record view is not displaying user name, it shows empty.
On other hand when I use rule input even for display value it is taking my input text and showing up in record view.
I just want to auto pick up username and insert in my record view which will populate my Datastore(Appian DB)
mkhaiserulla said:so I used loggedInUser() under display value in interface and choose a rule input to save it to data type
I have no idea what this means in terms of the configuration you're attempting to use, and even then I'm pretty unclear on what you're even trying to do.
What is your use case? What is your starting point? What is your on-form code? Can you share a small code snippet and/or screenshots of your configuration?
In a User Interface a save to a rule input will only be triggered as the result of a User Interaction on the form. If you want the loggedInUser() saved to a column in a database table then set it in the process model after the User has submitted the form.
thanks, @Stewart I will try this and update back if it works, I am anyway using write to data base in the process model