Assigned To Value

Is there any way that I can get the value of Assigned To in Custom Script?

Use frm.get_docinfo().assignments

Thanks it helped me a lot it shows me the data like.

Now, I have 2 more queries.

  1. Which function will be used to extract the username from the string like substr,left etc.
  2. From where I can learn and find these kind of functions, I appreciate if you can tell me the best resource for the same.

Google is your friend.

The format is a dictionary search and learn about that, for a start go through this Python - Dictionary

I have tried but it is not working, I appreciate if you can help me in this regard.


use dict.owner

1 Like

Hi Anand,
I have tried it, but it is not working.


No messagebox shown.

As per the python code
frm is an object pointing to the function get_docinfo() of its class and assignments is the dictionary of the function get_docinfo()

I tried to print the owner name using

But it didn’t print anything, can anybody put a light on it?

the data is in JSON format. You have to parse it.


Hi RMehta,

The below code is throwing error on console.

frappe.ui.form.on(“Task”, “refresh”, function(frm){
cur_frm.old_state = frm.doc.workflow_state;
cur_frm.set_value(“task_status”, “In-Process”);
cur_frm.set_value(“assigned”, frm.get_docinfo().assignments);


whereas if I remove this line below line from the code it works fine:

Error on the console is:

Try this,


ref:“Uncaught SyntaxError: Unexpected token o”

1 Like

Great it worked, I appreciate if you can explain me the reason to use it like this.

Output of frm.get_docinfo().assignments is [{“owner":"”, “description”:“TASK00026”}]. Which is an array, containing dictionary as value at 0th index.
To retrive required dictionary, use it as frm.get_docinfo().assignments[0]

1 Like