Follow

Sending an email using workflow depending on field value

Applies To: Information Worker for SharePoint 2013/2016 and Cloud

In some cases depending on values inside PDF form, an email notification should be sent. For example once scenario is finished or after PDF form was approved, notification message should be sent to specific email address.

This guide illustrates scenario where an email notification should be sent if check box inside PDF form is checked. Information about recipient is also extracted from PDF form, such as: name and email address.

Step 1. Create Template

In this template following fields and check boxes are used:

  • First Name (FirstName) - used by workflow in generated email message body;
  • Last Name (LastName);
  • E-mail Address (EmailAddress) - used by workflow as recipient address;
  • Checkbox (ConfirmationBox) - main trigger which triggers email sending.

Once check box is checked, workflow will proceed with email generation using values from "FirstName" and "EmailAddress" fields.

 

Step 2. Set default value for checkbox

In the ribbon menu navigate to "Options" tab → Rules. In "Client Rules (PDF Form)" click on "Load" event. Create following set of actions:

1) Click on orange stripe and select "If… then...";

2) In “if” clause in the dropdown menu select "PDF Field value...";

3) Then select appropriate name of checkbox (in this example "ConfirmationBox");

4) Click on "not equals";

5) Select "Manual bool value..." for another dropdown menu in the same action;

6) Click on appeared "False" option and in dropdown menu select "True".

Click on main clause:

1) In dropdown menu select "Action...";

2) Start typing following action: "Set field value";

3) In first dropdown menu select "Pick a field" then click on your checkbox name;

4) In second dropdown menu select "Manual value..." then click on "Text value";

5) In appeared field write "No".

After all actions are completed the result will look like following:

 

Step 3. Deploy the template

Click on "Publish" button, which is located in the bottom right corner to deploy template to the SharePoint library:

 

Step 4. Create workflow using SharePoint Designer

1) Navigate to Workflows → List Workflows → in dropdown select your deployment library ("Form Templates" in this example):

Name workflow and click OK.

2) Click inside "Stage 1" first and select "PDF Share Forms IW: Read Field Values":

  • Click on "field names", write text field names (where user will write E-mail Address, First Name and select Checkbox) from your created template, use coma to separate names (in this example: "FirstName, EmailAddress" and "ConfirmationBox");
  • Click on "this", select "Current Item".

3) Click on orange flashing stripe under created action and select "Core Actions: Get an Item from a Dictionary":

  • Click on "item by name or path", write in the name of any of text fields or checkbox which were mentioned earlier ("FirstName, EmailAddress" and "ConfirmationBox");
  • Click on "dictionary", in dropdown select the variable of read fields in action above (in this example "Field Values3");
  • Click on "item", in dropdown select "create a new variable" and name it;

4) Do action “Get an Item from a Dictionary” with all text fields mentioned in first action (“Read Field Values”) As the result it will look like following:

6) Click on orange flashing stripe under created actions and select "Conditions":

  • Select "Common Conditions: If any value equals value";
  • Click on first "value", in "Data source" dropdown and select "Workflow Variables and Parameters". In "Field from source" dropdown select check box variable (The variable of "ConfirmationBox" field – "Variable: Checkbox_Value"):

  • Click on second "value" of "Common Conditions: If any value equals value" write "Yes";

7) In main clause add an action : "Send Email with Attachment":

  • Click on "these users" to open email message editor, in "To:" field select book symbol:

  • In appeared window select "Workflow Lookup for a User..." then click "Add" button;
  • In new window in the "Data source" field select "Workflow Variables and Parameters" and in "Field from source" select E-mail Address variable (Email_Value);
  • Add text in "Subject" field (in this example "Form Submit");
  • Add text to the email body:

Note: in this example name was taken from field of the PDF form. To do so place cursor where value should be added, click on "Add or Change Lookup" and select the variable you need.

  • Close email message editor by clicking on "OK".
  • Click on "this address", write the E-mail address which will will be used as sender email address;
  • Click on "this" in "choose item" section of the action, select "Current Item" to attach PDF form to the email message;

8) Click on area inside "Transition to stage" section and add an action: "Go to a stage";

  • Click on "a stage", in dropdown menu select "End of Workflow".

As the result, workflow will look like following:

 

Step 5. You can set workflow to execute automatically

Navigate to Workflow Settings → in Start Options select “Start workflow automatically when an item was created”.

Note: workflow is also can be set to start when "item is changed" in case if scenario assumes that email notification should be sent not during the initial form submit.

Save and Publish created workflow.

 

Step 6. Navigate to the deployment library

Open new PDF Document. Fill-in the blank fields and select checkbox. Then click “Submit”.

Once workflow will finish processing submitted form, if check box "ConfirmationBox" is checked - it will send following email message to the email address added to "EmailAddress" text field:

With attached PDF form instance:

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Oskar

    For sharepoint 2019 On premise and sharepoint 2013 platform
    After a long search for a module that sends email, I can recommend a ready-made one. here is their website https://activitydeploy.com

Please sign in to leave a comment.
Powered by Zendesk