You are viewing limited content. For full access, please sign in.

Question

Question

Retrieve workflow initiator email address

asked on January 13, 2021

Is it possible to retrieve the email address of the workflow initiator from an SDK script? I thought maybe there would be something to do with the UserInfo class, but there's nothing to do with email within that class.

0 0

Replies

replied on January 13, 2021

Depending on how your user records are set-up, you may be able to get it with standard Workflow activities.

Try the "Find User" activity, with the option to search for a user from a token.  There are two standard tokens %(Initiator) and %(Initiator SID), which match to the "Find User" activity's Account Name and ID options respectively.

2 0
replied on January 13, 2021

Hi Matthew,

 

Thanks for the quick response. The Find User activity does work for what I am trying to do (and in fact that's what I used instead of retrieving the email through the script.) I was just wondering if it's also retrievable through an SDK script out of curiosity.

 

Thanks,

1 0
replied on January 13, 2021

For LF users, it's a user attribute,  [Workflow]E-mail or [Forms]E-mail, depending on how it was set. Find User looks at both.

For AD users, you'd have to read the user properties from AD, so that would be out of scope for the LF SDK.

2 0
replied on January 13, 2021

Thanks, Miruna. I'm not sure if it's ideal, but I was able to get it to work with this code:

 

SecurityIdentifier s = new SecurityIdentifier(GetTokenValue("Initiator SID").ToString());
var reference = new AccountReference(s,this.RASession);
TrusteeAttributeCollection attributes = Trustee.GetAttributes(reference,this.RASession);
string email;
attributes.TryGetValue("[Workflow]E-mail",out email);
SetTokenValue("Initiator Email",email);

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.