Posts

Showing posts with the label Flow

Salesforce Fact #999 | User permission check using LWC exposed as flow local action

Image
With the Winter'26 release, we can now create flow local actions using LWCs. One use of this feature is checking user/custom permission of the current user. Suppose we have created a screen flow and in between the process we need to check whether the current user has the permission to Activate Contracts and then route to the appropriate path. This can be easily figured out using the userPermission module in LWC and the same LWC can be utilized as a local flow action instead of using any complex apex code logic. Attached are the screenshots.

Salesforce Fact #987 | Skip matching records in flow create records

Image
The 'Skip the matching records' option flow Upsert operation is pretty helpful. If this option is selected, the flow first fires a SOQL to find out the matching records and if any found, skips the Create DML. This is not the case in Apex and in case of Upsert, it always fires the DML regardless of the record's existence. Attached is the screenshot.

Salesforce Fact #983 | Access stage resource in another flow

Image
Do you know we can use a stage resource in one flow which has been defined in another flow. Here is the syntax to access the stage -> namespace:flowName:stageName In the example screenshot, we are accessing the stage resource 'StageA' which has been defined in 'Mainflow1' and setting it as the current stage.

Salesforce Fact #982 | Field integrity exception while deploying a flow

We might encounter the below error while deploying a flow, which calls a subflow and accesses it's outputs: field integrity exception: unknown (the element has an invalid reference to The fix is to deploy the subflow first and then the main flow. Reference:  https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000Kg0LM0AZ

Salesforce Fact #963 | Access formula fields from Create Records

Image
With the Winter'26 release, we can now access sobject fields from the Create records element without an additional Get records. This also works fine for local formula fields(not for cross object formula fields). This is similar to the Formulas.recalculateFormulas() function but doesn't consume any SOQL query. In this example, we have a formula field on case which calculates a date 10 days plus the Createddate. In the flow, we are creating a case record and referring the same field from the Create Record reference, it shows the value correctly. Reference:  https://admin.salesforce.com/blog/2025/improve-automation-with-winter-26-flow-features-be-release-ready Attached are the screenshots.

Salesforce Fact #962 | SOQL syntax error in Get Records while using IN operator and sorting

Image
We need to be careful while using the IN operator in Get Records element along with sorting of the result by a field. If the text collection is null which is used in the Id filter, the underlying SOQL throws a syntax error. As a best practice, it is always preferred to check if the collection var is null or not. This also avoids one SOQL query. Attached are the screenshots. Reference:  https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000JfvwISAR

Salesforce Fact #910 | Picklist Contains operator in flow Get Records with translation

Image
Similar to apex, we need to be careful while using Contains operator in flow along with picklist translation. In this example, we have added the french translation for the Account Industry picklist value 'Banking'. Now, while using Contains operator on the Industry picklist in Get Records element, it works fine for English language but does not work for French language. No records are fetched in the Get Records for french user. To resolve this, we need to remove the Contains check from the Get Records and check the same by adding a decision element afterwards. Attached are the screenshots.

Salesforce Fact #901 | Few things to consider while using Data Import Wizard

Here are two things to keep in mind while importing records with Data Import Wizard: 1) The fields available for mapping is based on the layout of the selected record type and the field level security of the user. 2) While importing records we need to select a checkbox named 'Trigger workflow rules and processes for new and updated records' in order to trigger the automations in place for that object. Reference:  https://help.salesforce.com/s/articleView?id=000387837&language=en_US&type=1

Salesforce Fact #893 | OLI insert/update triggers Opp triggers and flows

When an Opportunity Product record is created or during update if certain fields like Sales price/Quantity is updated, it executes the before and after update triggers and flows on related opportunity. So, we need to be careful while creating any automation on Opportunity Product. Reference:  https://salesforce.stackexchange.com/questions/184659/opportunitylineitem-fires-opportunity-trigger

Salesforce Fact #856 | BatchApexErrorEvent subscribe using flow

BatchApexErrorEvent  is a built in event which is triggered for unhandled exception in batch class. In order to raise platform events from batch apex, we need to implement Database.RaisesPlatformEvents interface. We can subscribe to BatchApexErrorEvents using platform event type triggered flow. Reference:  https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/sforce_api_objects_batchapexerrorevent.htm

Salesforce Fact #806 | Flow Transform(Beta) in action

Image
Suppose we need to show the account names in capitalized format after retrieving in screen flow. Now, no need to iterate over the list of accounts. We have the Transform(Beta) component which can take care of the formatting right when the mapping is done. Attached are the screenshots.

Salesforce Fact #805 | $EachItem in Transform element in flow

Image
So we have the Transform(Beta) element in the flow. Using this we transform the data from a record or collection and store it in another record or apex-defined variable. If we see the formula syntax, for collection type it uses the [$EachItem] merge field syntax for iterating over each item in the collection. In this example, we have a get records element which fetches the account records and this is used in the Transform element to get the account names. Reference:  https://help.salesforce.com/s/articleView?id=sf.flow_ref_elements_transform.htm&type=5 Attached is the screenshot.

Salesforce Fact #800 | Another POC with Http callout from flow

Image
Sometimes we need to work on some finance related requirement where the amount needs to be shown in words as well like the option we have in physical cheques. We can use a web service callout to do get the details and that can be invoked from a screen flow. Note: This one does not work on digits after the decimal. Attached are the screenshots.

Salesforce Fact #799 | Change response data type in flow callout

Image
While using Http callout in flow, it is possible to change the output format of the response from application/json. To change this, Setup -> External Services -> Click on the Actions dropdown for the respective external service-> Edit -> change the content to the required format e.g. text/plain -> Save & Next Reference:  https://salesforce.stackexchange.com/questions/409668/how-to-use-http-callout-action-in-flow-with-body-of-content-type-application-x Attached is one sample screenshot.

Salesforce Fact #787 | UserPermissionAccess

There is an object named UserPermissionAccess which represents the permissions accessibility of the current user. We can use Get Records element on this object in flow to check permissions like 'Activate Contracts' or 'Activate Orders' of the current user. Reference:  https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userpermissionaccess.htm

Salesforce Fact #766 | Translation for flow custom error message

Image
With the Winter'24 release, we have the flow custom error component available for use. We can use both custom label and translation workbench to enable translation for the error message shown using this element. Attached are the screenshots.

Salesforce Fact #742 | Another POC on flow Http callout

Image
Suppose we want to get the country flag image for account shipping country in account detail page. We can use HTTP callout from screen flow to get the data. Attached are the screenshots.

Salesforce Fact #732 | Show image in flow send email

Image
How to show image in the email sent from flow Send Email action? Here are the steps to follow: Upload the image in the Documents -> Select the checkbox 'Externally Available Image' -> Right click and open the image in a new tab and copy the url -> Use the same in the flow text template. Attached are the screenshots.

Salesforce Fact #711 | Autolaunched flow from approval process

In order to launch an auto-launched flow from field update of approval process, the flow API Version needs to be v54.0 or higher. Reference:  https://salesforce.stackexchange.com/questions/328871/flow-builder-not-firing-up-after-approval-process

Salesforce Fact #710 | Auto activate process/flow setting

By default, active processes and flows are deployed as inactive in production org. But there is a setting under Process Automation Settings which auto-activates the deployed flow/process.  This change applies to autolaunched flows and processes which are deployed through change sets and Metadata API and this setting is available only in production orgs. Reference:  https://help.salesforce.com/s/articleView?id=sf.flow_distribute_deploy_active.htm&type=5