Checkbox True if Certain User is Viewing Record
Assume we have a Volunteer Shift Worker object with a lookup relationship called “Volunteer” to the User object. This way, each User can have multiple entries in the Volunteer Shift Worker object.
Create a checkbox on the Volunteer Shift Worker record that is automatically checked if the user looking at a record is also the Volunteer, and unchecked if not. This field will be helpful when reporting on a volunteer’s specific records.
Create a checkbox formula
IsShiftVolunteer on the Volunteer Shift Worker object with formula:
$User.Id == Volunteer__r.Id.
The prompt is taken from content on Salesforce's Trailhead website.