Run Flow as Another User in Salesforce : Bijay Kumar

Run Flow as Another User in Salesforce
by: Bijay Kumar
blow post content copied from  SalesForce FAQs
click here to view original post



**Summary of the Content:** This content is a tutorial about creating a screen flow in Salesforce for a real estate company, specifically focusing on two user profiles: Agent and Internal Sales User. The Agent collects basic customer information, while the Internal Sales User handles more sensitive financial details. Due to permission restrictions, the flow must be able to run as another user to allow access to necessary fields. The tutorial explains how to set up the flow to run in "system context," enabling the flow to bypass the restrictions of the logged-in user. It details the prerequisites, such as creating user profiles and field-level security, and guides users through creating the flow step-by-step. It emphasizes the importance of testing the flow from the perspective of different users to ensure proper access levels. **Key Details:** - Two user profiles: Agent (limited access) and Internal Sales User (full access). - Agents collect basic client info; Internal Sales Users complete profiles with financial data. - The flow must run as a different user to access restricted fields. - Steps include creating a record variable and ensuring field-level security is respected. - Final testing is crucial for functionality and permission validation. **Additional Information/Context:** In Salesforce, managing user permissions is critical to maintain data security and compliance. By utilizing the "Run Flow as Another User" feature, administrators can ensure that flows are designed correctly, adhering to the specific permissions each profile has. This is particularly vital in industries like real estate, where sensitive financial information is involved. **SEO Hashtags:** #Salesforce #ScreenFlow #UserPermissions #RealEstate #SalesforceTutorial #FlowAutomation #DataSecurity #FieldLevelSecurity #SalesforceAdmin #CRMDevelopment


In Salesforce, while creating a screen flow for a real estate company, I had to consider field access for two user profiles: Agent and Internal Sales User.

  • The agent collects and submits only basic customer details, such as name, contact information, and preferred location.
  • The internal sales user completes the rest of the profile, including financial information like budget and loan requirements.

Since agents don’t have permission to view or update sensitive fields, I needed to perform actions beyond the permissions of the logged-in user, so I need to flow to run as another user.

In this tutorial, we will learn how to run Flow as another user in Salesforce. In that, I will explain how to create a flow that requires the necessary permissions to be assigned to a system administrator to run the flow as another user, and how to do it.

What Does ‘Run Flow as Another User’ Mean in Salesforce?

In Salesforce, when a system administrator creates a flow and wants to see how it works for a different user (not the one currently logged in), they can run the flow as another user. This helps test or run the flow using the different permissions and access of that specific user.

This is usually done by setting the flow to run in system context, which means it doesn’t follow the currently logged-in user’s permissions. So even if a user doesn’t have access to fields or objects, the flow can still view or update that data.

Create a Screen Flow and Run Flow as Another User in Salesforce

Below, I will explain the prerequisites, settings, how to create a screen flow, and how to run a flow as another user in Salesforce.

Use Case:

We have two profiles: Agent and Internal Sales User. After creating the screen flow, I want to verify the flow’s functionality, access level, and permissions from the perspective of another user, rather than that of the logged-in user. For that, I need to run the flow by another user.

Prerequisite:

First, I have created two profiles, named “Agent” and “Internal Sales User,” and assigned users to these profiles.

  • Profile: Internal Sales User.
  • User: Jimmi Anderson.
Create Custom Profile in Salesforce
  • Profile: Agent.
  • User: Ella Edward.
Create New Profile in Salesforce

Now, you need to create the fields that will store the information about the clients, and then assign field-level security to them. For this, I have created a custom object: Client__c.

The Agent profile has limited field access for security purposes, while the Internal User has full field access, as given in the table below.

Field Label API Name Visible to Agent? Visible to Internal Sales?
Client Name Name Yes Yes
Mobile Number Mobile_Number__c Yes Yes
Email Email__c Yes Yes
Preferred Location Preferred_Location__c Yes Yes
Budget Range Budget_Range__c No Yes
Credit Score Credit_Score__c No Yes
Loan Requirement Loan_Requirement__c No Yes
Agent Comments Agent_Comments__c Yes Yes
Internal Notes Internal_Notes__c No Yes

In the image below, you can see the fields that I created. While creating the field, you need to select the field-level security. There, you can give and restrict access to fields for the profiles.

Create Fields in Salesforce

Create Screen Flow

Now, we will create the screen flow that adds the fields from the client object. We will then run this flow from the profile users we created and see what happens if we run it as another user.

To create the flow, navigate to Setup -> in Quick Find search for Flow -> New Flow -> Start From Scratch -> Screen Flow -> Next.

Now, in the screen flow, if we add the screen fields from the Component tab, then it will not respect the field-level security access.

That means even if we don’t grant access to users and we add the fields from the component, the fields will still be visible for that user when we debug the form.

For that, first, we need to create a record variable. Click the New Resource -> in Resource Type select Variable -> provide API Name -> in Data Type select Record -> in the Object select from which object you want to fetch fields and click the Done button.

Create Record Variable in Salesforce Flows

Next, add a Screen element to take the input from users. In this case, we are providing the client details. To do that, click the Fields tab, and it will ask for Record Variable; provide the variable that we created in the above step.

After providing the variable, you will see the fields from the client object. Then drag the fields you want to add to the screen. Provide the Label according to your requirement.

Add Screen Element to Flow Builder

Now, when the user provides the values in the fields that we added to the screen, we need to create client records using those values.

To do this, add a Create Record element, provide a Label, and the API Name will automatically populate.

Create a record from these values. Here, we need to select the record variable that we created.

Create Record Using Record Collection Variable in Salesforce

Now we are ready to save the flow. To do this, click the Save button, provide the flow Label, and the API Name will be automatically populated.

After that, always debug the flow before activating it to ensure that the working flow is correct and that there are no runtime errors. Then activate the flow.

Debug Flow As Another User in Salesforce

Before activating the flow, we need to verify that the fields we added to the screen are displayed according to the field-level security we assigned to the users. For that, first, we need to debug the flow.

As you click the Debug button, you may not see the Run flow as another user option because initially, we don’t have permission for that; we need to assign permission to a system administrator.

Run Flow as Another User in Salesforce

To assign permission to a user, navigate to Setup -> Quick Find -> search for ‘Process Automation Settings‘. In that section, find ‘Let admins debug flows as other users‘ and check the checkbox.

Again, navigate to the flow and debug the flow. This time, you will use the Run flow as another user option.

Run Salesforce Flow as Another User

Next, select the user for whom you want to run the flow so that we can verify the flow we created and ensure the field we added is displayed according to the field-level security assigned to the user’s profile.

Here, I have selected Jimmi Anderson, a user who is assigned to the Internal Sales User profile. For this profile, we have granted all fields access, and as you can see, when we click the Run button, all fields are visible.

How to Run Salesforce Flow as Another User

Now, again, go back to the flow and click the Debug button. This time, we will check with the Ella Edward user who has been assigned an Agent profile.

For this profile, we have granted access to only the necessary fields, and for security purposes, we have restricted access to some fields. As you run the flow, you can see that for this user, only a limited number of fields are displayed.

Run Salesforce Flow as Different User

In this way, we can we can run a flow as another user in Salesforce. After that, you can deploy this flow to Salesforce, and you can call the flow from a button whenever you want to create a record from the screen flow.

Conclusion

I hope you have got an idea about how to run Flow as another user in Salesforce. In that, using a real-time use case, I have explained how to create a flow, and before activating that flow, how to verify it using different user perspectives, and how the flow will run.

After we have also seen the necessary permissions that must be assigned to a system administrator to run the flow as another user, and how to do it.

You may like to read:

The post Run Flow as Another User in Salesforce appeared first on SalesForce FAQs.


June 16, 2025 at 09:19AM
Click here for more details...

=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce