Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Users, ALL by Name, pick list

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
tray1
964 Views, 6 Replies

Users, ALL by Name, pick list

I'm using the 

Users, ALL by Name pick list to get list of current users. once I have selected one user how would I go about getting that persons email address?

6 REPLIES 6
Message 2 of 7
bastien.mazeran
in reply to: tray1

Hi Tim,

This will require a behavior script.

You could use the Javascript split function to "split" your username selection in your picklist into two strings for firstName and lastName.

var selectedUser = item.USER_PL.split(", ");

From there you could construct a new user properties object, and set firstName and lastName as properties.

Then pass that user properties object to the Security.searchUsers() method and retrieve a new user object.

Finally set your email field to the email property found on your user object.

I hope this helps.

Regards,



Bastien Mazeran

Technical Support Specialist

Message 3 of 7
tray1
in reply to: bastien.mazeran

Great Help thanks, I didn't think it would be as involved as that.

I'll let you know how I get on.

Message 4 of 7
jpiggee
in reply to: tray1

Hi Tim,

 

I actually had the same question asked of me earlier so I figured I would share the full solution.

 

****Note: ****

This is based on a multi pick list and a scenario of 2 users with the same first and last name.

 

Solution:

var userName=item.APPROVALS_REQUIRED; // Get the users

var nameArray=userName[0].split(", "); // Split the name of user in question                                                       

var lName=nameArray[0]; // Last name

var fName=nameArray[1]; // First name

var userInfo=Security.searchUsers({lastName:lName, firstName:fName}); //find the user

var userEmail=userInfo[0].email; //return email of user in question

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 5 of 7
tray1
in reply to: jpiggee

HI Joe,

 

With a little help this is what I ended up with.

 

 

var selectedUser = item.ENGINEER.split(", ");
var user = Security.searchUsers({ lastName: selectedUser[0], firstName: selectedUser[1] });

if (!item.ENGINEER_EMAIL) {
//println(user[0].email);
item.ENGINEER_EMAIL = user[0].email;
}

Message 6 of 7
jpiggee
in reply to: tray1

Tim,

 

Nice solution as well. 

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 7 of 7
BiggePLM
in reply to: jpiggee

Tim and Joe,

 

Nice solution and thank you,

 

Great example of the new Security.searchUser function.

 

This along with pre-filtered picklist will make for many many options for workflow and notification assignments and checking with some inteligence to the options presented to the users

 

Much more useful

 

Thanks again.

 

Bob D

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report