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?
Solved! Go to Solution.
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.
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.
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.
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.
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.
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.
Can you do something like this Andrea?
Or if the Initiator sets the preparer1 field manually then:
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.
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.