Skip to main content

I got a form where there is a people field that populates the current logged in user. The field/list gives permission to all authenticated users from AD to submit a form; however, we have some shared accounts which the users sometimes "forget" and login with it and submit the form with that shared account. I want to prevent that and we want them always to submit that form with their personal accounts. What I'm trying to do is have a validation rule on that people field (display) to run in runtime which will throw a message if it finds that the logged in user is actually member of a group (which includes all the shared accounts). The message is to tell them that they cannot submit that form with the shared account and they will need to re-login with their personal account. note that I still want the people field in display mode (not enabled) - if possible.

Note: Highly preferable to stay away from JavaScript. This is a mobile form as well which will probably fail (not validate and throw errors on some platforms) if there is any JS on that people field.

I would suggest little different approach - base your validation on IsMemberOfGroup() function, which checks whether currently logged in user is member of a group.


Yes, that's actually the function that I'm trying to use. Sorry I wasn't so clear in my question. The problem is this function is not available in the rules/validations which I want to run in runtime when the user tries to save, then it should fire.

The only place that I can use it is in the field property called "enabled" = expression then insert the function. 

One more thing which adds to the compexity is that the group that I need to compare it to is an AD group.


see following thread reg. of usage of IsMemberOfGroup() function in place of runtime function

 

reg. of AD group, the function (resp. sharepoint itself)  is not able to resolve members of AD group. you will have to create a SP group for this purposes.


Hmm.. I'm not sure I'm getting your point from the link of the article thread. I don't see any mention of the IsMemberOfGroup() function. 

Good to know about the AD group limitation. 


ups, I'm sorry, I've pasted some wrong link.

I've updated my previous post, check the new link.

hope it helps.


No worries. Yes, that's exactly what I'm trying to do. But it is not working with Validation rules nor I can see that it actually works with formatting either. is it because of the Nintex/Sp version? we have on prem 2010! 

201672_pastedImage_1.png


I'm not sure, I have no experience with SP2010.

try to

- place single line text control on the form and set its default value to this formula

- place calculated value control on the form and set its formula to be  just the same

- create new item on list and check both how do they evaluate.


Hi ‌ - 

Did Marian's assistance help you out? If so, could you please mark one of his answers as correct?

Thank you happy.png 

Also, hello, fellow Elantissian. 


Hi ‌ & ‌,

this didn't seem to work for me. I've used a different approach which is to exclude the users whose email address contains some certain keyword such as "admin - shared"... etc.  but I wasn't able to use the group itself so if the group had additional users that need to be excluded which emails contain different keywords, I'll have to update the formula. This was the only way I was able to workaround it.

But thanks for checking :-)

Also Helllo Hello fellow Elantissian... You can't imagine how excited I am to have you in the team 🙂 Hope you like it at Elantis happy.png


Reply