Retrieve Email Id from UserName in K2 Workflow

Retrieving the User's Email id Using User Name in the Context Browser Item in K2 Workflow

Open Workflow wizard, Drag Get Emails for SharePoint Users (SiteUrl, User Ids, K2 Label) from Inline Functions as shown in below figure.


 It will open below window




Here we have to give SiteUrl, User Id’s & K2 Label.
SiteUrl:      Current site URL
User Id’s:  Now am taking Creted By email from Item Reference
K2 Label:   K2


   Click OK & Finish .



Now we can save and deploy the Workflow. Hope it’s helpful..:)


Save As PDF Control to create K2 Workflow to send a mail using smart form with PDF



Save as PDF Control   
     We can use this control, when we have to create PDF has a same Form or View at a particular time when an event is executed.


We can easily create workflow to send a mail with PDF using K2 smart form with save as PDF control.

Navigate to your list, go to ribbon and Select the Application from K2 as shown in below figure.

         We are going to create workflow for New Employee Form, Select New Employee Form and Click on Edit.
    In Layout section add Save As PDF Control from the control panel as shown in fig and Click Finish.

    Now we have   “Design Workflow” using same form “New Employee”. Right click on the form & Select Design Workflow.
  Check the smart Form is submitted, Select the Form “New Employee” & default name will create for Workflow. If you want you can change the name of workflow. Click “OK
          
                     Drag Send E-mail to Configure & Click Next to Wizard Step
  Add to Address Email & Originator name from the Workflow context.

         
      Now add attachments -> PDF from the Smart Object PDF File as shown in below Fig.
                        
   It will open PDF window, Create new data field “PDF ID” with type Integer, and drag field to value. As shown in fig below.  
                      
                          
                           Click "OK".
Now go to File. Save & Deploy the Workflow.

 
Again go to New Employee Form & Edit, New Employee form -> Rules -> New Employee (Default) – select “Save button is clicked” -> Edit Rule.
     


Add the below rules from the action.                                                                                                  
i) Execute a control’s method. (Select Save PDF method)
     -> Click on Configure -> Drag Emp name to File Name. Click Finish.
ii) Start a Workflow (Select Employee Workflow)
- >    Click on Configure -> Drag Save as PDF to PDF ID. Click Finish.
           Click Ok.                   
                                                                                                                               
     Finally Click Finish & Right click the Form and Check in New Employee FORM.                                                                                                                                

   Go to Employee list in SharePoint. Add New Item into list & save.   

  
I got the mail with PDF Attachment.
                                
                    PDF Format will look like below.


   Hope its help. :)                                                                                                        

Create Workflow Using K2 Designer for SharePoint

We can Create Workflow easily using K2 Designer, When we submit the "New Employee form" we are going to send a mail.  
   You can check my previous post How to generate Smart Forms in K2 for SharePoint list
         Follow the below steps to create simple workflow using K2 smart form
How to Intigrate and generate Smart Forms in K2 using SharePoint list - See more at: http://www.dotnetsharepoint.com/2016/05/how-to-intigrate-and-generate-smart.html#sthash.ywxwpjfu.dpuf
How to Intigrate and generate Smart Forms in K2 using SharePoint list - See more at: http://www.dotnetsharepoint.com/2016/05/how-to-intigrate-and-generate-smart.html#sthash.ywxwpjfu.dpuf
  Navigate to SharePoint Custom list -> go to ribbon and Select the Application from in K2    

      Right click on the “New Employee Form” & Select "Design Workflow

        Check the smart Form is submitted, & Select the Form “New Employee”. Click “OK

                                 
   Work flow for Sending Emails to the User
I It will open designer defiantly, drag Send E-mail to start the Workflow
Drag “Emp Name” from Item Reference & click “Finish
                            Now go to File. Save & Deploy the Workflow.


       Now “Add” New Employee from SharePoint list and save. Mail received to the Form Submit user.


How to generate Smart Forms in K2 for SharePoint list

We can use default SharePoint list Form as a smart Forms in K2. For that we need to generate smart forms in K2 application using custom list. We can able to edit that forms in K2, it will integrate to SharePoint directly. Following below steps to Generate K2 Smart Forms.
Navigate to SharePoint custom list (Employee)
                           
  
 Now go to ribbon and Select the Application from K2 as shown in below figure. 
                      

When first Time Click on K2 Application the below screen will appear.
Data Field will be checked default. This will generate List Smart Objects
To Creating Smart Form in K2 Application for SharePoint List.
 Go to New -> Select “Generate Forms
Check the Check box & Click “OK”. We can use these Forms as the New, Edit, and Display Forms for this SharePoint List.
                                        
  It will generate default Forms and Views.
     This Process will generate List New, Edit and Display smart forms automatically for the SharePoint List.