Problem Statement
Provide access only to the person whose name is present in the column Employee name of the particular list item; or,
The list item is only visible to a person whose name is present in the Employee name column.
Solution
- Create SharePoint List named “Review List”.
- Go to Settings and rename the title column as Name and create columns as shown in below table.
sr no
|
Column Name
|
Column Type
|
Description
|
1
|
Product Name
|
Single Line of text
|
Renamed Title column
|
2
|
Employee Name
|
Person or Group
|
People Picker
|
3
|
Approval Status
|
Choice (menu to choose from)
|
Pending, Approved, Rejected (by default Pending)
|
4
|
Comment
|
Multiple lines of text
|
For comment
|
- Edit the list by using SharePoint Designer.
- Create a workflow named “ItemPermission” for “Review List”.
Steps for workflow
Step 1
We will use the Impersonation Step to replace the permission.
Step 2
Add the List Action “Replace List Item Permission” under the Action heading as shown below.
- Click on these permissions, as shown below.
- Click on the "Add" button and click on the checkbox(es) of your choice depending on your permission requirement (I checked edit as of now).
- And then, click on "Choose...".
-
After clicking choose button, Select User window will open and you can select the user to whom you want to give access, double click second option “Workflow lookup for users”
- A new window will open named “Lookup for person or group” and choose,
- Data Source – Current Item
- Field from the source – Employee name (we will provide access to name present in this column of the current item)
- Return Field as – Display Name
- Click OK (Lookup for the person or group window)
- Click OK(Select User window)
- Click OK(Add permission window)
- Click Ok (Replace Permission window)
A total of a to g steps, and later the window will look like following.
-
Click on this list and select a current item in the "Choose list item" window.
- Click OK.
Here workflow completes, now go to workflow setting and select following checkbox from start option.
- Allow this workflow to be manually started
- Start workflow automatically when an item is created.
Click on Publish workflow.
Click OK.