Haaron Gonzalez – Blog in English Rotating Header Image

Nintex Forms

Best Practices for Nintex Forms Development

Good day people, its long time without posting here. Starting today I promise to myself start doing it more often. Looking at my backups found some conference notes that I took while attending Nintex conference few years ago. Wanted to share these notes related to Nintex Forms

Best Practices

  1. Ensure you know what the customer wants to do without a form or a workflow design, just identify what they need from the business perspective, don’t jump into Nintex right away, try to understand the business outcome first

Form Design
Don’t go crazy with form design, first make sure you capture the fields that are important and make things work as expected

Follow this process:

  • Perform a basic form design
  • Make things work in the form
  • Ask for feedback
  • Make final layout touches

Naming Controls

  • Name all form controls
  • Name needs to be unique
  • Make the name relative to the information that it holds
    • CAL_LineTotal
    • RPT_Price (unbound controls)
    • SUM_TotalAmount
    • TXT_Product

Binding Controls

  • Bind controls when applicable
  • Do not bind 2 controls to the same SharePoint column

Associate controls & labels

  • Add name to labels
    • LBL_Name
    • LblName
  • Associate label to control

Data Validation

  • Manage validations at SharePoint list
  • Use the control settings
  • Use control rules
  • You can hide and show labels based on rules in order to have validations while you type data in the form

Panels

  • Allow us to group controls together
  • Provides a better vertical experience
  • You can also apply rules to panel so you can disable a whole section
  • Makes moving easier

Simple & Advance Rules

  • Choosing what works best
  • Create one “Complex Rule” or many “Simple” rules
  • Try to keep it simple
  • Rule stops working, don’t know why?

Form Redirect on Submission

  • Providing a better experience
  • Send people somewhere meaningful
  • Use the redirect form to point to another form
  • You can relate multiple forms as part of a process using the redirect option

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.