How to autofill email based on AD user
I am very new to Workflow, I started using it on Monday. I have created a simple form that asks a user for some information in regards to a trouble ticket in Workflow 7(basically a front end for HelpDesk). At first I built out the workflow where the user had to type in their email address, now I would like to move to getting their AD user details and autofilling their email into the field.
My currently workflow looks like this:
Webform Project:
Start
Get Current User (HttpContext) outputs 'CurrentUser'
Split Text into Collection splits 'CurrentUser' into domain and username using \ delimiter, outputs 'UserCollection'
Get Users with Details picks from user container and finds the [UserCollection].last (logon name) in the pre-windows 2000 username field. Outputs to 'FoundUser'
On Success -> Copy Data Element to New Location takes [FoundUser].last (should always be fetching a single user anyway) to output 'CurrentADUser'
On Null -> Goto Duplicate form where they can manually add their email address.
On Error -> Goto End
After a successful find of the user they should be presented with a form where they fill out the title, comment, severity, and priority of the ticket. The issue I am experiencing is that Email Address: isn't being populated. The form contains [CurrentADUser].EmailAddress put into the top of the form as a field builder. When I sign into my laptop as myself and go to the page after a quick load 'Email Address:' is empty.
Once the user submits the ticket they are directed to a page that displays a success message that auto closes in 5 seconds and the helpdesk is notified of the ticket and the end user receives a confirmation email.
tl;dr -> How do i determine a current AD users email address and auto populate it into a field so they don't have to type.
Edit: Forgot to add, I have input the details of the DC to use and changed web.config to 'Windows' authentication.
Comments
Is this running in debug or
Is this running in debug or have you published it? I would run it in debug and check the execution path. Make sure the "get users with details component" is actually finding the user. If the email field is blank, it might be going to your duplicate form. Other than that, it sounds like your setup on the webform is correct.
I went through a support
I went through a support call with Shawn Turnbow and we got it figured out. In the AD Component of 'Get Users with Details' I was only searching the "Users" container instead of the entire domain. I was assuming that surely a user would be found in the users container, I guess that didn't quite prove to be true.
Everything is working great now, now its on to add child-parent drop down functionality.
Would you like to reply?
Login or Register to post your comment.