Open specific panel from Nintex Workflow URL link

  • 19 September 2016
  • 19 replies
  • 16 views

Badge +5

I have a Nintex form with five panels and at the bottom of each panel I have buttons (previous page, next page) with javascript.

In a Nintex Workflow Email Action, I have the URL to open the nintex form in edit mode but I need to this to open up on the first panel rather than the last panel.

Is the a command or setting I can add to the URL or Nintex Form to open in edit mode to a specific panel?


19 replies

Userlevel 5
Badge +14

I guess you have some state variable within the form that controls which panel should be shown.

so you can define a default value for that variable, so that needed panel gets showed. if you need it, you can build simple if statement that sets different value for each of new/edit/view modes.

if you want to to control what panel to show via URL, you can append to it something like '&PanelToShow=1'

then you will get that value within form using inline function fn-GetQueryString('PanelToShow')

Badge +5

Could you give some more specific detail on how I do this....I'm a newby

Userlevel 5
Badge +14

can you post how does the rule(s) that controls single panels to show/hide look like?

Badge +5

I followed this post from the Nintex forum to set up the next/previous pages panels https://community.nintex.com/docs/DOC-1361

Userlevel 5
Badge +14

Michael, since you haven't posted your specific setup, I still might be too general.

I will follow naming from the post you linked. if you have customized it, you might need to adapt it according that.

in the linked post the main driving variable/control is hiddenTxtBox, so you will have to supply a (default) value for that control via URL.

in the linked post, control's default value is always set to 1, meaning first form/tab always  to be activated in New form.

however, (as you noticed) this doesn't have any effect on Edit form since in edit form default values are not populated.

to change that behavior you will need.

- post a default value via URL like: <URL you used up to now>&hiddenTxtBoxDefaultValue=12345

(replace 12345 with your chosen form/tab ID)

- populate control's default value with formula like

fn-If(fn-IsNullOrEmpty(fn-GetQueryString('hiddenTxtBoxDefaultValue')),1,fn-GetQueryString('hiddenTxtBoxDefaultValue'))

that will ensure to take over value from URL in New mode, if supplied, otherwise it  sets default value to 1

- to populate default value in Edit mode you will need this small javascript

NWF.FormFiller.Events.RegisterBeforeReady(function () { 
  if(Is Edit Mode) {
      var defaultValue = NWF.Utilities.GetQueryString(window.location)['hiddenTxtBoxDefaultValue'];
      if (defaultValue == undefined || defaultValue == ''){
         NWF$('#'+hiddenTxtBoxId).val('1');
      } else{
         NWF$('#'+hiddenTxtBoxId).val(defaultValue);
      }
  }
})

copy&paste that script to form's custom javascript.

make sure 'Is Edit Mode' is not copied as a plain text but rather replaced with reference.

Note hiddenTxtBoxId is javscript varable defined for hiddenTxtBox control.

Badge +5

Sorry, I will try to put as much detail as possible.

I have a Nintex form consisting of four panels. At the top of the form I have a series of  buttons

192770_pastedImage_1.png

Against each panel I have a rule:

192771_pastedImage_2.png

Using Nintex Workflow I send an email to a user with a link to this Nintex form, but I would like it to open on a specific panel, e.g. "Stage 2: Development".

Thanks

Userlevel 5
Badge +14

so your driving control/variable is 'Tabs'.

it should be equivalent to hiddenTxtBox control from the link and my post.

you haven't mentioned that and it's even not clear from your pictures, I just assume if you carefully followed provided link, it's (hidden) single line text control.

you haven't raised any question or problem in your post so I'm not sure what a problem you still might experience.

hopefully my post is clear enough to match it to your case now.

if not, raise specific questions you need to help with.

Badge +5

I have not even tried your solution as I am a bit confused about what needs to be done. In this example, I don't have a hiddenTxt box, I only have the

192772_pastedImage_1.png .

Q: Where to do I place the "populate control's default value with formula like " ...??

Q. How do I determine the Panels ID?

Userlevel 5
Badge +14

you have implemented it a bit differently comparing to link you have posted.

instead of (hidden) single line text control you hold current active panel in choice switch.

therefore it doesn't 100% fit to your case, and that's exactly  the reason why I asked you to post your specific setup at the very beginning...

the concept remains moreless the same, however, forcing value of choice switch buttons is a bit more  complex.

and the important point is, how you'd like resp. need to hand over choice value in URL.

you can hand over choice option text itself, which makes thing even more complicated, since you will have to take care f URL encoding/decoding of the passed text value at the both ends.

I would suggest to reference respective choice option by its position and I will provide a solution for that below.

so let's repeat adapted procedure once again:

- post a default value via URL like: <URL you used up to now>&panelSelectorButton=1

(replace "1" with your chosen button/panel positional reference - eg. 3 for 'stage 3')

- preserve setting of choice control's default value to static value as you have posted it on screenshot above (stage 1)

within the 'default value'  you will not be able to translate positional argument to option value

- to populate default value in Edit mode you will need this small javascript

 NWF.FormFiller.Events.RegisterAfterReady(function () { 
   if(Is Edit Mode) {
       var defaultValue = NWF.Utilities.GetQueryString(window.location)['panelSelectorButton'];
       if (isNaN(defaultValue))
          defaultValue = '1';
       NWF$('#'+varTabs).find('span:nth-of-type(' + defaultValue + ')').find('label').click();
     
   }
})


copy&paste that script to form's custom javascript.

make sure 'Is Edit Mode' is not copied as a plain text but rather replaced with reference.

Note varTabs is javscript variable defined for Tabs choice control (button)

Badge +5

You are dealing with a newby here, so I am not sure where or how to "post a default value...."  can you give me a bit more basic detail on how to do each step....thanks

Badge +5

This is what I think I was supposed to do....maybe I have misunderstood or missed something:

  1. In the Tabs section I changed the default from 'STAGE 1: CONCEPT" to a URL https://teams-ishare.mla.com.au/buadmin/b03/stage_gate_project/Lists/Stage%20and%20Gate%20Tool/EditForm.aspx?ID=ID&panelSelectorButton='STAGE 1: CONCEPT'
  2. I added varTabs to the same Choice settings

192957_pastedImage_1.png

  1. I copied this JavaScript in to the Form Settings

NWF.FormFiller.Events.RegisterAfterReady(function () {
if (Is Edit Mode) {
var defaultValue = NWF.Utilities.GetQueryString(window.location) ['panelSelectorButton'];
if (isNaN(defaultValue))
defaultVale ='1';
NWFS('#'+varTabs).find('span:nth-of-type(' + defaultValue + ')').find ('label').click();
}
})

But it does not seem to be working??

Userlevel 5
Badge +14

steps 2 and 3 are ok,

step 1:

- do not change Tabs default value, keep it STAGE 1: CONCEPT

step 4 (proof check):

- copy&paste following link to the browser

change "ID" reference in the link to some real ID

'3' at the end mean 3rd Tab should be opened (change it acc. your needs)

https://teams-ishare.mla.com.au/buadmin/b03/stage_gate_project/Lists/Stage%20and%20Gate%20Tool/EditForm.aspx?ID=ID&panelSelectorButton=3‍

styep 5:

- in workflow configure mail notification action so the it include link like in step 4

 

Badge +5

Sorry, but this still does not work. The form still opens up on the last select (STAGE 4: EVALUATION) regardless of what number (1,2,3 or 4) that I add to the end of the URL.

Userlevel 5
Badge +14

can you check developer console (F12) whether there are not reported any errors?

Badge +5

I opened the form in Edit mode and this is the only error I get

193019_pastedImage_1.png

Userlevel 5
Badge +14

so that's likely the reason why it doesn't work.

when you click on the error it should navigate you right to the line causing the problem.

correct the error (missing semicolon) and try to test it once again.

Badge +5

Still does not work!

Userlevel 5
Badge +14

are you able to debug through the code to investigate what's going on there?

Userlevel 5
Badge +14

Hi Michael Campbell‌, did you come to a resolution with this?

hopefully you didn't give up laugh.png

Reply