Hide Panel in a Nintex Form when \New Mode\" doesn't work"


Badge +7

I have a form that gets filled out by Initiator. There are panels in the form that should only be visible to Preparer 1 so that Initiator doesn't fill them out. The problem is that when the form is entered into the library, the workflow hasn't run yet, so the Preparer 1 field hasn't been populated yet (workflow looks to a Business list to find Preparer 1 associated with that business because I can't look up a People Picker column).

Hiding the panel based on "New Mode" doesn't work, even though a document is entered into the library by the Initiator and it is a new form being filled out. Hiding based on "Edit Mode" works, but then it is hidden from Preparer 1 as well.

I've thought about hiding the panel based on a SharePoint permission group, but it doesn't appear that this is an option inside a form.

I tried setting a form variable to a specific user,  but that didn't work. Perhaps I was doing that wrong. Regardless, I don't want to get into hard coding individuals, even though the Initiator is always the same person. I'd like to keep my rules based on flexible things like permission groups or columns.

So I want to hide a panel in New Mode and based on a people-picker field that gets updated later via workflow. How do I do that if "New Mode" doesn't work and how do I write a rule to hide based on the value in the Preparer 1 people-picker column?

Any suggestions?


14 replies

Userlevel 6
Badge +12

Hi Andrea,

the IsNewMode runtime function should hide that panel so we should probably investigate that but another way you could do this is to set a status column and default it to "new" and then write your hide formula based on that status.  Your workflow would change the status value.

Just so I understand properly.  Does the IsNewMode method hide the panel when the form is new?  i.e. does your panel have a rule that looks like this enabled?

That should definitely hide the panel.  If your issue is the initiator can create a new item, have the panel hidden but then after saving they can quickly return to the form before the workflow kicks off and then they'll see the new fields because they're no longer hidden.  If that's the case, use something like a status field and hide based on that rather than a person.  As you say, hard coding based on a person will end up as a maintenance nightmare.

Cheers,

Chris

Badge +7

I happen to already have a Status column! I went into the form and was partly able to make this work. The Status column defaults to "New", so I am able to hide the panels from Initiator when the document is uploaded to the library. However, when the document is saved, the workflow runs and the Preparer 1 column gets populated. Then while the status is still "New", Preparer 1 goes in and updates the fields in the hidden panel. So hiding the fields based on a status of "New" partly works, but the status is still "New" when Preparer 1 goes in to fill out the fields in the hidden panel. So I have figured out that half.

Whew. The things people ask for.

I still need a rule that will hide a panel if the person accessing the form is not Preparer 1. Preparer 1 will be populated after the document is saved and the workflow runs. I have not been able to create a rule that will compare the current user to the value in the Preparer 1 column. Even if the column were blank, it wouldn't matter because the rule would only need to work after the document has been saved by Initiator. I've found many discussions on how to do this and each seems to offer a different solution, but I can't make any of them work. Any other suggestions?

And no, I do not understand why IsNewMode doesn't work when a document is uploaded and the form is being filled out for the first time. We upgrade to a new version of forms in February, so maybe that will solve the problem.

Userlevel 5
Badge +14

I do not understand why IsNewMode doesn't work when a document is uploaded

for document library, NEW event happens once you upload a document.

then you are provided with option to update/edit document properties in library forms. but the form is already in EDIT mode at this timepoint (library item has already been created).

try to add calculated control value controls on the form  and set their formulas to IsDisplayMode resp. IsEditMode to proof check.

Userlevel 6
Badge +12

Good point Marian.  I hadn't realised Andrea was working in a doc library.  Andrea - my IsNewDoc suggestion works for custom lists but not for doc libraries for the reason that Marian suggested.  If you use the status field will that work?  The workflow presumably initaites when the initiator saves the form for the first time so if the panel is hidden by default (i.e. status = new) then it's up to the workflow to change to the status and the panel should display for Preparer 1.  And/or hide the panel if the Preparer 1 column is null or empty.

Cheers,

Chris

Badge +7

Thank you for that clarification. I didn't realize it would be different for a library vs. a list. I will try to use a calculated control. I'll report back when I get a moment to circle back.

Badge +7

It partly works. I can hide it based on a status of "New", but the status remains as "New" until after Preparer 1 reviews the document properties and makes a determination. Once that determination is made, it flags the workflow to proceed and change the status to "In Progress". So yes, it worked. But no, it's not 100% because Preparer 1 still needs to review those fields and if they are hidden based on a status of "New", the Preparer 1 won't see them either.

I'm going to take a look at Marian's suggestion and see if I can make that work.

Userlevel 6
Badge +12

Can you do something like this Andrea?

  • Initiator uploads the document and fills in metadata.  Panel is set to hidden if the Preparer1 field is empty
  • Workflow starts and sets the preparer1 field
  • Preparer1 opens the form and they will see the panel

Or if the Initiator sets the preparer1 field manually then:

  • Initiator uploads the doucment and fills in metadata including preparer1 field.  Status defaults to "New".  Panel is set to hidden if the status is "new"
  • Workflow starts and checks if the preparer1 field is populated.  If it is, it changes the status to "In progress"
  • Preparer1 opens the form and they will see the panel

Cheers,

Chris

Badge +7

I've tried hiding the panel if Preparer 1 is blank, but that hasn't worked right, either. I notice that sometimes the rules don't work very well when you have several rules applied to a panel or a lot of conditions in the rule. I'll revisit this option, maybe there is something I missed or did wrong. I even created a second, hidden text column for Preparer 1 just in case the rule was having trouble reading a people-picker column, but that didn't work either.

Like I said, we get upgraded to the newest version of forms sometime around February. Maybe all of these problems will be resolved with an upgrade.

The team is testing the workflow today, but I will take a look at the form tomorrow and report back.

Userlevel 6
Badge +12

Yes it does sound like you might be having some conflicts on that panel.  You can try changing the order of execution of the rules (just click on the rule and drag it up or down the list).  You could try writing a really simple formula to hide that panel.  If it hides, great - it means your panel doesn't have issues.  If it doesn't hide then we'll need to look at how the different rules are interacting with each other.  As you say, the latest version might fix this but we might as well give this one a test with your current version.

Badge +5

this may be helpful here.

to hide/show a panel based on membership in a security group you can use "fn-IsMemberOfGroup" inline function

go to the Panel settings--> Appearance --> Visible

Set this to Expression and add fn-IsMemberOfGroup("YOUR GROUP NAME")

this means the visibility is handled not based on New Mode or Edit Mode, but only on membership of user in a group

if you want to show the panel to multiple groups you can use

fn-Or(fn-IsMemberOfGroup("GROUP1"),fn-IsMemberOfGroup("GROUP2"))

Badge +7

That did the trick for the first 2 times I accessed the form. Now I get an error message that says:

Error in formula: Unable to get property 'top' of undefined or null reference

When I delete the fn-IsMemberOfGroup("TNRPreparer1"), I don't get that error anymore. Is this because our version of forms is out of date? I couldn't find anything specific to this issue in the release notes, so I'm not convinced that's it. When you click the OK button on the dialogue box, it pops up again, but then you can complete the form.

I  have one calculated field in my form that is hidden if the form is not in Edit mode and that recalculates in Edit mode, but that has always worked fine.

Any idea what could be causing this?

Badge +5

Hey Andrea,

sorry was out on vacation so couldn't reply.

were you able to solve this one ? 

Badge +7

I still get the error message, but the team did not report ever getting it. Using the permission group to control the form was a great solution, but I have no idea why the error message occurs. I wasn't able to find anything on Google about it, either.

Badge +5

haha lucky... as long as users dont complain all good :-)

Reply