When using InfoPath forms, and Nintex workflow, there are a few ways to view the InfoPath form. You can either :
- Open the form by clicking on the link within the form library – and do save/submit, etc – and you’re redirected back to the form library
- Click on a link as generated by an Email (item URL within Nintex) – and do save/submit – and you get “Form was closed” – annoying ??!?
My recent customer was asking if they could auto-direct back to the Forms Library after saving the form – so I did some checking of the URL’s.
When you click on the form as in #1 above – this is the URL :
BUT – when clicking the email link – as generated by Nintex Workflow (using the “Item URL” variable) – you get this :
Notice anything missing ??
The basic problem is that one of the ‘QueryString’ values is missing – ie. the “SOURCE” list. This is a ‘url-encoded’ name-of-page-to-redirect-back-to.
So – to solve the problem at hand – I did the following :
- Within Nintex Workflow, create a variable called FormUrl (as opposed to ItemUrl)
- Add a Build String activity (at the start)
- Include the “ItemUrl” – and then…
- Store the value into “FormUrl”
- Whenever needing to send the URL in an email – just use my custom variable (FormUrl) – not ItemUrl.
Keep in mind that you need to change the “Source” url – depending on the library name and/or site – OR – you could re-direct back to the home page for the intranet after completed.
That works nicely – and people don’t get the dud “Form has been closed” screen after saving & submitting – when viewing the form via Email Link (ItemUrl).