SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to get access to the current view name in InfoPath?

For example I want to use it in a condition on a rule:

If current view = X then set the value of a field on load.

This is part of implementing a sharepoint group based permission system for controlling access to particular views of a form.

The current plan is have a series of rules that say if current view = X set a required group field to y. If user is not in group y then switch to read only view.

share|improve this question
up vote 0 down vote accepted

I don't think so..

However if you set the view explicitly on form load then at the same time as you set the view you can set any fields or view specific values you want

For example If you had a couple of boolean fields that define permissions like:


Then on form load you call the GetGroupCollectionFromUser method on the SharePoint UserProfileService as described in detail here:

you can then run a series of checks to see which group the user is in and set the boolean fields.

The boolean fields makes the rules to hide sections and set the view mush easier to write.. and read

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.