Get Logged In User's Email ID

How can we get User full name from session??


I need this too. You found a solution?

EDIT: Is there a way to prefill a doctype with values, which we can not get by Customize Form?

I tried to add the full_name of the current user to a custom field, but I couldn’t get it work by Customize Form. By JavaScript/jQuery, I would need a seperate AJAX request, just to get the full user name, as following:

#client side in mycustomdoctype.js{
			method: "mycustomapp.utils.get_full_user_name",
			args: {"user": frappe.session.user },
			callback: function(r) {
				if(r.message) {
					frm.set_value("current_user", r.message)

#server side

def get_full_user_name(user=None):
	p = frappe.db.get_value("User", user, "full_name")
	return p

As this may be useful for someone, I like to post it here, but as I wrote, it it a separate AJAX request, for a very basic information.

Is there a way to solve it server side?

EDIT: For a client side solution, use sione solution below:

(we are still searching for a server side solution, without the need of a separate AJAX request)

1 Like

This is what I used to get the user fullname

var Current_User = user;{
	args: {
		filters: {'email': Current_User
	callback: function(r) {
		cur_frm.set_value("User_Full_Name", r.message["full_name"]);
1 Like

Good solution! Better than mine. It reduces the need of custom server side scription.

@sione, @ci2016,

To get the logged in User’s fullname you can use the frappe.user.full_name(uid) in custom script directly no need to use the to fetch the user_info as it is already available.



Thanks a lot…much easier solution

Thank you. Where does uid come from?

Reference Error: uid is not defined


uid is the user’s email id, you can get the uid from frappe.session.user variable


Excuse me:

i need to add custom filed in quotation
name it

Quotation By
and this filed take its data from the current login user

For example if the login user is
so when this user make a quotation
the filed will automatically take its name
as the one who made this quotation
how can i achieve this ?

best regards .

I would find this useful too

Its already there u can check the owner field in the db.


also create a int field called valdone so you don’t keep overwriting every time you save

	validate: function(frm) {
			if(cur_frm.doc.valdone !== 1 ){{
			method: "frappe.client.get",
			args: {
				doctype: "User",
				filters: {"email":user}    
			callback: function(r) {
					frm.set_value("quotation_by", r.message.full_name);		
					frm.set_value("valdone", 1);					
1 Like

@Julian_Robbins @ kindly check my answer

Hi @makarand_b

This solution returns the value “You” instead of the actual name of the user!

Kind regards,

For fetching logged in user’s ID, try



Hi @jaichavan

This works fine for user ID though I was also hoping to get the actual Full Name

Thanks a lot

For seeking Full Name, try:


1 Like

Works for me:


Hi @jaichavan

This works perfectly. Thank you!

Kind regards,