With the field in place, we can set up the rule which will define the sharing.
From the app launcher, open the FormulaShare app (if you don't see this, follow the steps in Permission Set Assignment to assign the FormulaShare Admin User permission set).
Rules are created from the FormulaShare Rules tab. Click "New Rule" to start setting one up.

The options below are set in this screen:
- Label, API Name and Description: Add something to distinguish this rule from others
- Object to Share: Select the object from the list of those available to share. Objects included are those which:
- Support sharing - child objects in a master-detail relationship and some standard objects do not support independent sharing rules
- Have an internal or external organisation-wide default sharing setting of either Private (for Read or Edit access levels) or Public Read Only (for Edit access level)
- Location of field with user, role or group: Objects can be shared based on values in fields on either the object itself (these rules are known as Standard Rules), or an object or custom metadata type related through a series of lookup or master-detail fields (these rules are called Cross-Object Rules). Limits apply to the total number of active rules of each kind
- Share With: The type of entity this rule should share with. Options for FormulaShare Lite are "Users", "Roles", "Roles and Internal Subordinates", "Roles, Internal and Portal Subordinates" (includes both community and portal users) and "Public Groups". FormulaShare Enterprise and Unlimited also include options to share with Manager Groups or users' Account or Opportunity Default Teams. The Territories of Account / Lead option is provided in all versions if Enterprise Territory Management is enabled in the org.
- Specified in Field: The field which contains a reference to the user, role or group needing access. Fields which can be chosen are text fields, formula fields returning text and or lookups to the user object. The field selected should be populated with either the Salesforce 15 or 18 character id of the user role or group, or the role or group name (developer name) for sharing to work correctly
- Conditions: Use this option to apply rules only when specific filter conditions are met on the shared record or related records. See the Rule Filter Conditions section for full details.
- Advanced settings: Revealed by clicking the hyperlink. See See Advanced Rule Settings for full details around configuration options provided here
- Access Level: Set to Read or Edit. For objects with an organisation-wide default sharing setting of Public Read Only, only the Edit option will be available
- Sharing Reason: Available for custom objects only. A unique sharing reason must be used for each rule, and the name of the sharing reason must be unique across all rules (including those for other objects). To set up a new reason, click the Manage Apex Sharing Reasons link below the field - clicking the refresh icon after setting this will show the reason to be selected
Clicking Save on this screen deploys details of the rule to be set up as custom metadata in the FormulaShare Rules custom metadata type. See the accessing and deploying rule metadata section for details of this.
Related Articles: