PeopleEditor control… and that stinks because this thing is damn hard to work with.
Add a reference to the jQuery library to the page as well (What? You aren’t using jQuery? What? How’s that 5.25" floppy treating you grandpa?). Now for the tricky part. The PeopleEditor control is rendered out in this nasty implementation of hidden input controls, maybe there’s a TextArea control if you are using a specific browser, then there are a bunch of nested SPANs and DIVs that don’t have specific a NAME or ID that’s easy to find. So… you have to get creative.
Now there are plenty of posts online talking about reading/writing to this control, but none really gave me exactly what I needed, so I had to roll up my sleeves and what follows is how I pulled the value out and stuffed it into the params array that the sample code creates for you:
// get reviewer loginname
var html = $("#ctl00_PlaceHolderMain_docReviewerUser_upLevelDiv");
params['DocReviewerLoginName'] = $("#divEntityData", html).attr("key");
And there you have it… this will pull the claim ID of the person you selected in the PeopleEditor and pass it along as a string to the workflow as an argument. Of course this doesn’t just apply to a SharePoint 2013 workflow… this technique works if you need that value outside of a workflow as well.