Home SalesforceFlow Show User Record Access Using Flow

Show User Record Access Using Flow

by Dhanik Lal Sahni

Most of the time, we want to show some information about whether the user has edit access on record or not. This will help them to avoid clicking the edit/save button after changing some record information. This post will explain how to show user record access using flow.

Record access can be given to the user using a profile, sharing rules, permission sets, or using any other record-sharing mechanism.

Let us see how to show whether the user has access to the record or not. We can use UserRecordAccess object to get record access information. We can get information like the user has edit access, read access, delete access, or edit access using this object.

In this post, we will show, whether the user has edit access or not on the current Case record. We will use screen flow to show user information.

Steps To Show User Record Access Using Flow

  1. Create a record Id variable
  2. Get record access using Get Element
  3. Show access information using the Screen Element
  4. Test Flow

1. Create a record Id variable

We need recordId to get user access to a record. So we need recordId as input to flow. Create a string type variable with API name- recordId.

RecordId in Flow

2. Get record access using Get Element

Now let us get record access information using the UserRecordAccess object. We need a Record Id and User Id to get user access information. We will use the Get Record element to retrieve access information.

Get Record in Flow

We will save retrieved access information in the variables. I have used hasEditAccess to store edit access information and recordId to store RecordId. It is mandatory to select RecordId field. Based on your requirement you can retrieve HasDeleteAccess, HasReadAccess, or HasAllAccess fields and display information.

Select Fields in Saleforce Get Record Element

3. Show access information using the Screen Element

Now we have record access information in local variables., We will add a Screen element and Display Text Control to show edit access information using those local variables.

Display Text Element in Flow

Similarly, we can create another screen element for showing Read Only text information. Which will show “Record is Readonly”.

The complete Flow will look like below

Show User Record Access Using Flow

4. Test Flow

The flow will show user access detail on the record page.

Show User Record Access Using Flow

Related Posts:

Data Table in Screen Flow

Multi Select Lookup in Screen Flow

You may also like

Leave a Comment

Top 10 Enterprise Integration Use Cases Top 10 SOQL Best Practices Top 10 Salesforce Security Best Practices Salesforce Spring ’23 Enhancement in Lightning Components Salesforce Spring ’23 Enhancement in Apex