Depending on your requirements you could do one of these options:
- Add a people picker field to the InfoPath form to directly add the people involved to the form. From there if you push that field to the SharePoint list as a column, you can reference that column in SharePoint Designer's workflow.
- Add a column or two in the form library that you fill out manually once the form has been submitted. From there you can reference that column in the workflow designer.
- Make a new list with a text column and X people-picker columns. Connect that list as a data connection and put the contents of the text column as a dropdown menu. From there you can use the value that the user selected to look up the other X people picker columns from your workflow to reference in your email.
- A poor choice is to make N versions of your workflow that reference the N different sets of people you may want to email. But this is not advised.
Do any of these ideas seem viable for your situation? If not, can you explain more of what's going on? Things like how many sets of people are there? Or are they random people each time?
If you need help brainstorming more, let me know. I can even toss up an example or two if you're interested.
Updating for example.I noted from another answer that you're using SharePoint 2013 and InfoPath 2013 and that I think you know how to publish forms. So from there...
Make sure you've got the Person/group Picker field added to your SharePoint library via the publishing wizard.
IMAGE: Example of added fields to column list...
Once you've finished publishing and have set up the submit connection, add your people. Here's an example where I add myself to the "From" and "To" fields.
IMAGE: Filling out sample form...
After submission to the library:
IMAGE: Showing submitted form in library...
In a new SharePoint 2010 workflow (here I'm using SharePoint Designer 2013 to make a 2010 workflow), make an email command. Here's how you find the people in question:
Inside a step, type "Email" and hit Enter. A command should show up that looks like below:
IMAGE: The 'Email' function in SharePoint Designer Workflows...
In the "To"
- Select the book to the right
- "Workflow Lookup for a User..."
- Under Current Item, find the field you named back when you added the fields from your form as a column to the library. I forgot to change the names to unique names, so here they both are called "Display Name" but you can name them whatever from the publishing wizard in InfoPath.
IMAGE: Adding the linked columns of people to emails...
Do the same in either the "To" or "CC" section of the email interface for whoever is supposed to be the "from" column. I put one in "to" and one in "cc" as I'm in both spots for my example.
Write your email how you want. You can add references to the people in your letter, or just make it generic. You can see part of an email in the background of the previous image I posted.
Save the workflow, and go back to the workflow's properties. Select "Start workflow automatically when an item is created".
IMAGE: Setting workflow to start on submission
Publish the workflow.
Doing a sample with the form that was created you can see I'm in both the "To" and "CC" sections of the email. If I had used someone else's email you'd notice that the To is to whom the task is assigned, and the CC is who sent the task.
IMAGE: Sample Email
Connecting fields to your SharePoint library:
From the InfoPath Designer, go
Publish (left hand side) >
Publish Form to a SharePoint Library. From there the wizard should pop up:
IMAGE : Publishing Wizard Step 1. Site URL.
Enter the url to your site, including the protocol (http:// or https://). Click Next and select "form library":
IMGAE: Publishing Wizard Step 2. Type of Form.
Either create a new library, or select a library that you want to add the form to:
IMAGE: Publishing Wizard Step 3. Library selection.
Click Next, then "add" in the top section to add a column to SharePoint. Go into the folders and select either AccountId or DisplayName. DisplayName works for my email system. Not sure about yours. Set the three dropwdowns similar to below:
IMGAE: Publishing Wizard Step 4(ish). Selecting field for column.
Do the same with the other person picker. The window should look like this after adding the two people pickers as columns:
IMAGE: Publishing Wizard Step 4. Added Columns.
Click Next and Publish.