How to Construct the Email To activity in SharePoint 2013 Workflow

I have a created a custom workflow and custom association and initiation form using SharePoint 2013.
My Assn. form is fine.  I pass in the people picker (Active Directory group) value to my workflow just fine.
Now on my Init form I use the passed in value from people picker and display a list of users and email addresses from the people picker group.  The list of users and email addresses are listed in a table with a check box to the left of each row. I am
using JQuery, Knockout and MVC web service to retrieve the values from the group.
All is well.
Now my users pick who they want to send the email to.  Let's say they pick two users!
When the user clicks the submit button, I have JSOM code which starts the workflow and sends in the 2 users email addresses as an argument to theworkflow.
 Note:  I tried sending my two emails as a collection and failed.  So i converted it to a string.  The variable is called strUsers.
Since the argument is a string and Email Activity requires the To attribute to be an array, I use the BuildCollection<String> Activity to convert my string to an array.
Now in my workflow I use WriteToHistory Activity to write out my BuildCollection variable (recipients).  Here's what is sent to the workflow history... [email protected];joejones@yahoo,com)  Note:
 Both names are bogus and I'm not Joe Jones.
I then configure the email Activity and set to To property to my BuildActivity variable (recipients).
When I deploy my Visual Studio 2013 solution, and attach my workflow to a publishing page, I am getting this error after I submit the Init form.
An unhandled exception occurred during the execution of workflow instance.  System.ArgumentNullException.
Does anyone know of an example of how to set up the Email To collection value.
Note:  I tried using comma and semi-colon for my string (strUsers).  Neither worked.
Thanks
Tom
none

I think I'm getting close.
Here’s an
article
that helped me out and below is my code.  Note:  I added a ParseDynamicValue and GetDynamicValueProperty to push the data from the "emails" property to colleciton of strings called EmailCollect.
Here is what the data look likes
The value of Selected Emails is [{"emails":"[email protected]"},{"emails":"[email protected]"}]
 Code excerpt in InitiationForm.  Note:  I am using MVVM and Knockout for the selected users from a list with checkboxes.
                //build array for workflow 
              var emailUsers =
new Array();
                //cycle through viewmodel emails
for (var
i = 0; i < viewModel.SelectedEmails().length; i++)
var a =
new Object();
                    a["emails"]
= viewModel.SelectedEmails()[i];
                    emailUsers.push(a);
wfParams['strSelectedEmailsHMgr']
= JSON.stringify(emailUsers);
                 // Get workflow subscription
and then start the workflow
var context = SP.ClientContext.get_current();
var wfManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, context.get_web());
var wfDeployService = wfManager.getWorkflowDeploymentService();
var subscriptionService = wfManager.getWorkflowSubscriptionService();
                context.load(subscriptionService);
                context.executeQueryAsync(
function (sender, args) {
// Success
var subscription =
null;
// Load the workflow subscription
if (subscriptionId)
                            subscription = subscriptionService.getSubscription(subscriptionId);
if (subscription) {
if (itemId !=
null && itemId !=
// Start list workflow
                                wfManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription,
itemId, wfParams);
Now I deploy and publish the workflow but now I’m getting this error when trying to 
System.InvalidOperationException: Looking up a value using a key is not supported on an instance of 'Microsoft.Activities.Dynamic.DynamicJsonArray'. at Microsoft.Activities.Dynamic.DynamicItem.TryGetValue(String
key, DynamicItem& value) at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj) at Microsoft.Activities.GetDynamicValueProperty`1.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
none

Similar Messages

  • SingleTask activity in SharePoint 2013 workflow - Send Assignemnt Email

    Hi,
    I'm using SharePoint 2013 SingleTask activity to create and assign task. However, on task assignment, user is getting notification though the alert is disabled in list level. There's no property in SingleTask expect 'SendReminderEmail' to define in the activity
    if I would like to send notification or not. Is there any way I can configure in SingleTask activity not to send 'task assignment' notification? My Single Task properties are given below:
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Hi,
    Any body has the solution of this. I am using SP 2013 on-premises env and developed a workflow using visual studio. I want to disable the default Task email and tried powershell given in different other articals.
    $list=$web.Lists.TryGetList("Workflow Tasks List")
    if($list -ne $null)
       $list.EnableAssignToEmail =$false
       $list.Update()
    and same code using c#, but both are not working. After changing the enableAssignToEmail property of list, I can see that property has changed and value is false. However mail is still coming for task. Restarted Workflow Manager service and IIS.
    Please provide if any body has solution of this.

  • Using an Email Alias in a SharePoint 2013 Workflow created in Designer

    Hello,
    I would like to use an email alias for a workflow that was created in Designer, I don't want the workflow email address to look like it was sent from the system or myself I'd like to use an email address our generic email address that our department uses. 
    I cannot see a way to do this.   All the email address we are trying to use are in our AD and are active.  Here is an example of what I am trying to do... 
    We’re going to be using a few forms I’ve created on SharePoint so that colleagues may submit requests for additional resources for virtual environments. In order for us to track the requests I’d like them to be dumped into the LT-Infrastructure
    board inside of ConnectWise, and the best method to do that would be via email.  Is it possible to have the email come out on a different address? (ex.
    [email protected]) After configuring the workflow and sending out a test I realized that its coming from
    [email protected](which I assume replied to you).
    Thank you in advance for your help.
    Joanie

    Hi Jdd,
    Thanks for posting your issue, Kindly browse the below mentioned URL to fix your issue
    http://www.lynda.com/SharePoint-tutorials/Using-email-aliases-easy-workflow-maintenance/144025/161261-4.html
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • How to get the list of active devices in current wifi network?

    Hi All,
    I am going to a start a new Network based app. So please any one give me an idea on the below question.
    How to get the list of active devices in current wifi network?

    Nope I want the log-in user to retrieve its Group where he is belong. I have this following code
    strUsername = Request.getParameter("username").toLowerCase().trim()+"@dev.test.com.ph";
    strPassword = Request.getParameter("password").toLowerCase().trim();
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    env.put(Context.PROVIDER_URL, MY_HOST);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL,strUsername);
    env.put(Context.SECURITY_CREDENTIALS, strPassword);
    // enable tracing
    env.put("com.sun.naming.ldap.trace.ber", System.err);
    // Create the initial context
    DirContext initCtx = new InitialDirContext(env);
    // Get the target context
    DirContext targetCtx = (DirContext)initCtx.lookup("");
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    // Perform the search on the target context
    NamingEnumeration enum = targetCtx.search("","(userPrincipalName="+strUsername+")",constraints);
    javax.naming.directory.Attributes attrs;
    NameClassPair item;
    String[] attrIds = new String[]{"MemberOf"};
    // For each answer found, get its "Groups" attribute
    // If relative, resolve it relative to the target context
    // If not relative, resolve it relative to the initial context
    while (enum.hasMore()) {
    item = (NameClassPair)enum.next();
    Out.println(item);
    attrs = targetCtx.getAttributes(item.getName(), attrIds);
    Out.println(attrs + "<br>");
         initCtx.close();
    It returns all this string :
    {memberof=memberOf: CN=CMCanadaRD,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=iMngrCanadaRW,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=Domain Users,CN=Users,DC=dev,DC=test,DC=com,DC=ph, CN=Backup Operators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph, CN=Administrators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph}
    How can i retrieve the Group named CMCanadaRW and CMCanadaRD on the Attribute?
    Thanks

  • How to stop the bridge.exe active as to install the new application eg.Flash CC?

    how to stop the bridge.exe active as to install the new application eg.Flash CC? please help?
    I can't install the any new application every time.

    Please refer:
    http://helpx.adobe.com/creative-suite/kb/error-installation-cannot-continue-bridge.html
    Regards,
    Ashutosh

  • How to setup the email application for my gmail account in firefox os.. I need the configuration steps for gmail.

    I don't know how to setup the email account sync in firefox os.. can anyone explain the steps to be followed for setting up a gmail account...

    hello Dhanraj K, for gmail accounts there shouldn't be much manual configuration required. please try to set it up like described in [[Add an email account to the Mail app in Firefox OS]]

  • How to configure the email in SAP

    Hi Experts,
         Can you please let me know how to configure the email in the server?
    Thanks in Advance
    Regards,
    Kuldeep Verma

    Hello Indu Rayepudi ..
    I have followed the Recommendations and everything is going well but I can only send emails from the same domain, how can I set up to send to hotmail, gmail, yahoo?
    Mi sap es SAP ECC 6.0
    The administrator said that the Exchange server already has registered the server's ip sap to enable him to relay this IP.
    But nothing happens.
    Do you have any idea? any help from you, I would greatly appreciate .. Gina
    Here is the error: http://img.photobucket.com/albums/v484/mauzzz/SAP/SO01Erroringles-1.jpg
    Edited by: GCH on Sep 25, 2008 11:24 PM

  • HELP!! How to get the position of active windows in the desktop

    How to get the position of active windows in the desktop

    You mean, active windows other than the program you're running, or windows the program puts there? And a real desktop (like where MyComputer is), or a desktop pane?

  • How to send the email to different email addresses from Workflow

    Hello,
    i an not getting that how to send the email from Workflow in SAP.
    plz give the steps to do that.
    i have done lots of time but system is not sending the email to different email address.

    Hi,
    lot of configuration is invloved in sending
    mail to external email id. check BASIS to
    configure for external mails ans also check
    debug FM and see which conditions exceptions
    (Document not sendis raised)
    also check below code
    CLEAR: DOC_CHNG, OBJTXT, OBJBIN, OBJPACK, OBJHEAD, RECLIST,
    RECIPIENT_INT, DOC_SIZE,TAB_LINES.
    REFRESH: OBJTXT, OBJBIN, OBJPACK, OBJHEAD, RECLIST.
    OBJBIN[] = CONTENT_OUT[].
    Populate e-mail title
    DOC_CHNG-OBJ_NAME = 'MAIL'.
    CONCATENATE 'EETS for Contract #'(245)
    OIA01_TAB-EXGNUM
    INTO DOC_CHNG-OBJ_DESCR SEPARATED BY SPACE.
    DESCRIBE TABLE OBJTXT LINES TAB_LINES.
    READ TABLE OBJTXT INDEX TAB_LINES.
    DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    It is a text document
    CLEAR OBJPACK-TRANSF_BIN.
    The document needs no header (head_num = 0)
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    but it has a body
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    of type RAW
    OBJPACK-DOC_TYPE = 'RAW'.
    APPEND OBJPACK.
    Create the attachment (the list itself)
    DESCRIBE TABLE OBJBIN LINES TAB_LINES.
    It is binary document
    OBJPACK-TRANSF_BIN = 'X'.
    we need no header
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    but a body
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    of type PDF
    OBJPACK-DOC_TYPE = 'PDF'.
    OBJPACK-OBJ_NAME = 'Attachment'(239).
    CONCATENATE 'EETS_' OIA01_TAB-EXGNUM '_'
    IT_ZMMTACCUID-ACCTUSRID
    '_' SY-DATUM '_' SY-UZEIT '.PDF'
    INTO OBJPACK-OBJ_DESCR.
    READ TABLE OBJBIN INDEX TAB_LINES.
    DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJBIN ).
    OBJPACK-DOC_SIZE = DOC_SIZE.
    APPEND OBJPACK.
    Get e-mail address
    CLEAR IT_ADDRESS.
    READ TABLE IT_ADDRESS WITH KEY ACCTID = IT_ZMMTACCUID-ACCTUSRID
    BINARY SEARCH.
    IF SY-SUBRC = 0.
    RECIPIENT_INT-ADDRESS = IT_ADDRESS-SMTP_ADR.
    ENDIF.
    *Send email to external mail address
    RECLIST-RECEIVER = RECIPIENT_INT.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    CLEAR RECLIST.
    *Send email to SAP Office mail address
    RECLIST-RECEIVER = IT_ZMMTACCUID-ACCTUSRID.
    RECLIST-REC_TYPE = 'B'.
    APPEND RECLIST.
    CLEAR RECLIST.
    SEND THE DOCUMENT BY CALLING THE SAPOFFICE API1 MODULE
    FOR SENDING DOCUMENTS WITH ATTACHMENTS
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    exporting
    document_data = doc_chng
    put_in_outbox = 'X'
    importing
    sent_to_all = sent_to_all
    tables
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    receivers = reclist
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    operation_no_authorization = 4
    others = 99.
    also check
    https:/Re: mail sending problem
    Regards
    amole

  • How to construct the constant pool?

    Greetings,
    I seems to have a little bit of a problem.
    I have a text file, generated by the javap -c <class_name> command,
    i.e.:
    javap -c myClass > myClass.txt
    This myClass.txt is the input I've got. I do not have the myClass.class, from which it was generated.
    What I wish to do, is to generate, from this text file, a leagal, runnable, class file (i.e., myClass.class).
    But, I have problems understanding how to construct the constant pool array.
    I have read the VM spec (java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html).
    The thing is, that it does not explain how to extract the needed information from the text file.
    Can someone assist?
    Would appreciate,
    Ohad.

    Compiled from Hello.java
    public class Hello extends java.lang.Object {
        public Hello();
        public static void main(java.lang.String[]);
    Method Hello()
       0 aload_0
       1 invokespecial #6 <Method java.lang.Object()>
       4 return
    Method void main(java.lang.String[])
       0 new #4 <Class java.util.Timer>
       3 dup
       4 invokespecial #7 <Method java.util.Timer()>
       7 new #2 <Class Hello$1>
      10 dup
      11 invokespecial #5 <Method Hello$1()>
      14 lconst_0
      15 lconst_1
      16 invokevirtual #8 <Method void schedule(java.util.TimerTask, long, long)>
      19 returnWell in this example, you have opcodes with arguments which are expressed as (for example) "#7 <Method java.util.Timer()>". This describes a constant pool element. I assume #7 refers to the location within the constant pool, and the text description tells you that it's an item of type method, and gives you the method name. So for all arguments expressed in this form, you'll need to reconstruct a constant pool item.

  • How to make the condition type active

    hi,
    how to make the condition type active when its in inactive stage and its showing yellow triangle and y in the control features of it.
    and
    how to solve if is showing a statement as "INITAILISED".
    regards,
    balajit

    Dear Balaji,
    Yes it will come as Inactive mode.....If you make the 2 condition Class is same in single Pricing procedure ,In Standard system will display like this only..
    For Example:PR00-Condition class is Price
    EX00-Condition class is Price
    Then first Condition type will become Inactive.. change the Class of the Second Condition Type.
    Best Regards
    raj.

  • How to use the Java embedding activity in BPel

    hi all,
    How to use the java embedding activity in BPEL
    pls can u provide sample example

    1 Use [Oracle BPEL Process Manager Client Java API Reference|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/overview-summary.html] and especially [com.collaxa.cube.engine.ext|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/com/collaxa/cube/engine/ext/BaseBPELXExecLet.html]
    Instead of System.Out.println use addAuditTrailEntry(java.lang.String message)
    2. If you want to import a package write in code (Source View) of bpel process
    +<bpelx:exec import="package_name"/>+ for example +<bpelx:exec import="java.util.regex.Matcher"/>+
    example 1:
    String bodyAsString;
    StringBuffer myStringBuffer = new StringBuffer();
    try {
    bodyAsString = (String)getVariableData("BodyString");
    addAuditTrailEntry("bodyAsString1: "+ bodyAsString);
    Pattern pattern = Pattern.compile("goodDay");
    Matcher matcher= pattern.matcher(bodyAsString);
    while (matcher.find()) {   
    matcher.appendReplacement(myStringBuffer, "shitDay");
    matcher.appendTail(myStringBuffer);
    bodyAsString = myStringBuffer.toString();
    addAuditTrailEntry("bodyAsString2: "+ bodyAsString);
    } catch (Exception ex) {
    addAuditTrailEntry("Failed+bodyAsString",ex.getMessage());
    I put in code (Source View) the following
    <bpelx:exec import="java.util.regex.Matcher"/>
    <bpelx:exec import="java.util.regex.Pattern"/>
    example2:
    Object temp;
    try {
    temp = ((XMLElement)getVariableData("inputVariable","payload","/ns2:FiscalisMessage/ns2:Body")).getChildNodes().item(1);
    setVariableData("AdjReceipt",temp);
    addAuditTrailEntry("ok",temp.toString());
    catch (Exception ex) {
    addAuditTrailEntry("Failed :",ex);
    I put in code (Source View) the following
    <bpelx:exec import="oracle.xml.parser.v2.XMLElement"/>

  • How to integrate the email content to workflow?

    Hi Experts,
    1. Is there any way to trigger a workflow when the user requests to create the material through the email?
    2. How to incoporate the standard material to the workflow?
    I want to knw about how to capture the email conternt fields and when the user send the request email to create the material.
    I'll highly appreciate if you can explain me how it be done.
    Thank you for your valuable time.
    Best Regards,
    Rashika

    Hi,
    This is my scenario,
    1. User will request to create the material by providing the material information in Excel sheet attached to the Lotus Notes email.
    2. Shared service team will receive the above mail. According to the mail, team will create the materials.
    3. When Material created, the user receives the email with the created material information.
    I have tried Tutorial workflow for "Material Create" in saptechnical site. Its working properly. I want to know how may alter this workflow to meet my requirement.
    So my problem is how do I do this with minimum cost? Because programming will cost & I'm new to the SAP workflows. Therefore please help me to do this done.
    Your kind help will be appreciated.
    Thank you
    Best regards.
    Rashika

  • How to validate the Email in JSF 2.0

    Hi,
    I am developing web application using jsf2.0.
    In this case, I wish to validate the email field with the help of import org.hibernate.validator.Email;
    But it is not working, How to validate the email fileld...
    Thank.

    ManiForum wrote:
    ...I wish to validate the email field with the help of import org.hibernate.validator.Email;
    But it is not working, How to validate the email fileld...Are you asking on how to do it with the Email class from Hibernate? Or, are you open to other alternatives?

  • How to reset your secret question, when you have forgot the answer. And how to change the email where the reset confirmation will be send towards?

    can anybody help with the question below?
    how to reset your secret question, when you have forgot the answer. And how to change the email where the reset confirmation will be send towards?

    You won't be able to change your rescue email address until you can answer your questions, if you don't have access to your current rescue account then you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset you can then use steps 1 to 7 half-way down this page to update your rescue email address for potential future use : http://support.apple.com/kb/HT5312

Maybe you are looking for