Send a Form Link via Workflow - Mel Balsamo
in

InfoPath Dev

This Blog

Syndication

Mel Balsamo

Send a Form Link via Workflow

Overview

How about approving workflow requests via email with one click?

With Qdabra's easy-to-install FormsViewer app, you can do this and more.

Wouldn't it make even more sense to approve workflows from a phone without having to login to SharePoint?

Well, now with FormsViewer, even external users can approve requests. One click. No log in required.

Faster, better, easier - that's FormsViewer!

Important: please don't attempt this while driving.

Requirements

You are a site collection admin.

Your site has the FormsViewer App installed, or your SharePoint admin can install it.

You have an InfoPath form or access to InfoPath Designer to create one.

Sample Scenario = Leave Requests

A Leave Request form is a common scenario where approvals are required.

Steps 

Employee requests personal time off (PTO)

  1. Employee navigates to HR site

  2. Employee clicks on Submit Leave Request

  3. Employee fills out form and submits

Manager is notified

  1. Manager receives an email summarizing the PTO request

  2. Manager clicks on link to approve or reject request

Components

To implement, you will need the following:

  • One Leave Request form (InfoPath)

  • One Manage Leave Request form (InfoPath)

  • One SharePoint 2010/2013 workflow

Note: You can download and install our Leave Request solution from the Qdabra web store here:
http://www.qdabra.com/webstore/p/1152/leave-requests-form

 

Technique

To approve or reject a request with one click, you need to tell the form whether you are "approving" or "rejecting" when you click. So, there are two links. One link has "&Approval=Approved" and the other has "&Approval=Rejected".

To create these links and send an email we will use SharePoint Designer…

Here's the workflow:

image1

Here's the email:

image2

Here's the link for "Approved":

image3

image4

To create a link for rejecting, you just change the "&Approval=Approved" to "&Approval=Rejected".

Now, let's take a look at the form.

Qdabra's Leave Requests solution has a form for submitting requests (Leave Requests form) and a form for managing the leave requests. Both are included in the package.

The workflow that sends emails with the approve-reject links is associated with the former Leave Requests form.

But, the links themselves point to the latter Manage Leave Requests form.

The Manage Leave Requests form opens when the manager clicks the link and there is logic after form load that sets the approval status based on the command that was passed.

Here's how the form canvas looks like in InfoPath Designer:

image5a 

Here are the rules that get the approval status:

image5b 

Notice that we are using the qRules command "GetInputParameter" to query the link for the Approval key. This key indicates whether the manager has "approved" or "rejected" the request.

After obtaining the approval status, we next need to get the ID of the form:

image6

Once again, we are using the qRules GetInputParameter command to query the form's ID from the link.

After getting the link, we can query the form:

image7

Notice that the rule queries the form from the Leave Requests library - that is where it was submitted.

Next, the form updates the library based on the approval.

image8

That's all there is to it.

Just create a workflow link that appends the form's ID and the Approval command. Then, in the form use qRules GetInputParameter to query these values from the link and perform some actions based on what they are.

To do this even if the user is not logged in, just add one more parameter:

image9

Of course, you'll want to look at the samples. :)

Comments

No Comments
Copyright © 2003-2017 Qdabra Software. All rights reserved.
View our Terms of Use.