Haaron Gonzalez Rotating Header Image

Nintex

How to display additional lookup data from another list in a Nintex Form

Let’s say that you have a lookup site column that you are using all over the place in multiple lists and sites under your site collection and you need to be able to display additional data from this important list in a Nintex form, there is a way fortunately.

By adding this site column into your content type or list the Nintex Form will identify field as a lookup control automatically and by using the lookup function you can query another list in the site collection and return data from it.

In this example, I have a Stores list, every store has a district number associated, so when I pick and choose a particular store number by using the lookup function I am able to return the district for the selected store.

lookup1

To understand how the lookup function determines what data to bring back, consider the following lookup function:

[code language=”css”]
lookup(“listA”, “ID”, 1, “Title”)
[/code]

This lookup will send a query to SharePoint, asking for list items within a list titled ‘listA’ and return the Title column value from any list items whose ID column value is 1.
Note: The match on the value is case-insensitive.

The lookup function does not support complex query construction; it determines what list items are included, as data to bring back, based on the filter column being an exact match to the value you specify. You can compose complex formulas with the formula builder if you need to build up a complex query, however be mindful that each lookup function will send an individual request to SharePoint for data.

So, in my example I just added a Calculated Value control in the Nintex form and configure the lookup runtime function like this:

[code language=”css”]
lookup("/sites/mysitecollection|mylist","ID",Store,"District")
[/code]

Notice that there is a “|” to point to a list in another site, in this case, the top level site using a relative URL Path, then delimit the list title with a pipe ‘|’ symbol. If your list exists under your current site just use the list title without the URL Path.

lookup2

 

How to read values from query string in a Nintex Live Form

I remember when a friend that was very good at writing technical articles and blog posts told me that he didn’t had the time to do it when I asked why he doesn’t blog anymore. That’s exactly what happened to me in the last couple of months or so. I apologize in advance.

Today, I want to share how you can read query string parameters using JavaScript and pass them into a Nintex Live Form controls.

Set the Client ID JavaScript variable name for your text box controls you want to set with the query string values

  • Select your text box control, right click settings
  • Expand the Advanced section
  • Provide a Client ID JavaScript variable name

Set the Client ID

 

Modify the Custom JavaScript i the form Settings

  • Click the Settings ribbon button
  • Expand custom JavaScript section
  • Create a JavaScript function to read and return query string properties ( I borrowed the function from here)

[code language=”css”]

var getQueryString = function ( field, url ) {
var href = url ? url : window.location.href;
var reg = new RegExp( ‘[?&]’ + field + ‘=([^&#]*)’, ‘i’ );
var string = reg.exec(href);
return string ? string[1] : null;
};

[/code]

  • Invoke the function to get the query string values passing the name of the parameter and use the NWF$ to set the values in the right text box. kmsid is my query string parameter

[code language=”css”]

var surveyId= getQueryString(‘kmsid’);

NWF$(document).ready(function() {
NWF$(‘#’+TitleControl).val(surveyId);
});
[/code]

Custom JavaScript

Now you need to make sure your Nintex Live form URL includes the Query String parameter we are referring in the code. In my case I created a Nintex Workflow that will send an email and in the email body a hyperlink to the Nintex Live form is included. I modified the hyperlink to have my query string parameter kmsid, just make sure you don’t use the default URL provided by Nintex Live, use the resulting URL of your Nintex Live form to construct the entire URL with the additional query string.

 

Speaking at Nintex Inspire 2016 in Las Vegas

I am so happy to announce that I’ll be speaking at Nintex InspireX Conference co-presenting with Tom Castiglia. We will share how to use Nintex Workflow & Forms and DocuSign fornintexinspire automating some of the most typical Human Resources process in a company. Nintex Workflow and Docusign can work together to request and retrieve digital signed PDF files for archiving the paperwork that needs HR by law need to retain. We automated some process for our customers and we want to share our overall solution approach.

Nintex InspireX will be on take place in Las Vegas, Nevada between February 22-24. In encourage you to review the agenda and awesome sessions/speaker line up.

Here the session details:
Using Nintex and DocuSign for Open Enrollment and Employee Onboarding, with Konica Minolta Business Solutions
When organizations hire a new employee, the onboarding process always requires the new hire to fill out, sign and submit numerous legally binding forms. These forms are typically provided by benefit providers and government agencies in paper and/or PDF format, and require a “wet” signature to be submitted. This session will show how to architect a re-usable solution based on Nintex Forms, Nintex Workflow and DocuSign, that can support any number of different third party forms, converted into DocuSign templates in order to capture a legally binding digital signature. We’ll also show dashboards for the HR Manager to monitor the progress/status of forms pending for each employee.

 

A quick tale from the SharePoint support trenches

Basically, the customer had a workflow, build in SharePoint Designer 2010 that will use some of the out of the box Actions like the Pause for Duration and Send Email. The issue was that once the workflow paused for a minute it wasn’t able to resume the work, leaving the workflow always running “In Progress”. Doing some research found KB2674684 SharePoint 2010: Workflow failed to run after pause and according to the description made me remember my good old ASP.NET developer days.

The bottom line is that SharePoint on premise is ultimately a Microsoft ASP.NET solution that works with multiple windows services and related Microsoft technologies/servers. From the web perspective Web Server Controls, Web User Controls, HTTP Handlers, Web Services, AJAX, ASPX pages, assemblies, web.config, page directives and so on are just pieces that work together to deliver a page that end users to consume.

Turns out that if you have the Workflow Timer Service started on a server that is running as an Application Server role “App” and you don’t have the SharePoint Foundation Web Application service started “basically the WFE role”, workflows will fail rehydrating the workflow when resume from a pause action, the reason why?, is because in order to rehydrate a paused workflow SharePoint needs to read some settings from the running web application web.config file, but because we have only the “App” role and not the “App/WFE” role running, it fails loading from the required Web Application the web.config file, because THERE IS NO web.config to load for that particular web application in the App server. The App Server without the SharePoint Foundation Web Application Service started only has available the Central Administration web application, not those additional web applications that WFE have available in IIS as a web site.

According to the article there are three methods for solving this issue:

  • Method 1: Locate one Web Front End server, which has Web Application service running, run the following PowerShell command to copy workflow-related configuration from the web.config to the configuration database so it will be available from every server in the Farm.

$webapp = Get-SPWebApplication -identity http://<web app name>

$webapp.UpdateWorkflowConfigurationSetttings()

  • Method 2: Start the Web Application Service on all servers that have the Workflow Timer Service is running.
  • Method 3: Disable the Workflow Timer Service on servers that are not running the Web Application service.

I decided to use Method 3 because we have dedicated App server and dedicated WFE server.

By the way, if you have Nintex Workflow installed in your farm, what just explain also apply. Nintex Workflow should run only n WFE servers, so make sure you Workflow Timer Service is stopped on all app servers in your farm.

Thanks for reading!