Solved

Comparing current logged in user with field on list

  • 18 May 2021
  • 1 reply
  • 78 views

Badge +8

OK I'm having an issue trying to get this to properly work. Basically I want a user to only be able to fill a form once. I have a workflow that pulls the display name from CreatedBy field. I also have a calculated field (not connected to anything and called CalcName) and a people picker (Name) that the user puts their name in. So basically if the Name matches any item on the list then it disables the Submit button, maybe unhides a panel telling them they fill it out already. I've tried a number of different ways but I just can't get it to work. Thanks everyone

icon

Best answer by ctoper11 18 May 2021, 21:39

View original

1 reply

Badge +8

OK I've figured it out. I'll write out what I did and I hope it helps others. I created a people picker called Name two calculated fields one called CalcName the other CalcLookup and added formulas. Under CalcName I put to get currently logged in user


 


userProfileLookup(Current User, "PreferredName")


 


for CalcLookup I queried the same list the form is built on


 


lookup("SameList", "Created By", (userProfileLookup(Name, "PreferredName")) , "Person")


 


to disable the Submit button I added the following rule:


 


equals(CalcLookUpCalcName)


 


And lastly as an added bonus I put a panel with a label in with warning text not to fill out the form twice and added the below rule


 


equals(CalcLookUpCalcName)


 


Works really well now only one person can fill out the form on the list. Thanks to everyone on this board.

Reply