Posts

Showing posts with the label Flow

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

Salesforce Fact #685 | Record lock check in flow

Image
We can create an Invocable method to check whether a record is locked or not. It is useful whenever we need to check the same in flow. Attached is the screenshot.

Salesforce Fact #677 | Flow security

Permission for a flow is checked only at the top level. For example, flow A calls flow B. User X has a profile that can access flow A but not flow B. User X can execute flow B, but only through flow A. User X can’t execute flow B directly. Reference:  https://help.salesforce.com/s/articleView?id=sf.flow_distribute_security.htm&type=5

Salesforce Fact #642 | Record choice set limit

The maximum number of choices which can be shown for Flow Record Choice Set component is 200. So, we need to filter out records if there are more than 200 records. Reference:  https://help.salesforce.com/s/articleView?language=en_US&id=sf.flow_ref_resources_recordchoice.htm&type=5

Salesforce Fact #633 | Flow: Check of target collection is empty after filter

Image
While using collection filters in flow, if we need to check whether the target collection after the filter is empty, isNull operator does not work. Because an empty target collection after the filter has the value as []. So, we can create a dummy blank collection filter.  In this example, we have a collection filter on a list of account records. Now, in order to check the target collection is empty or not we are comparing it with a dummy blank collection filter. Attached are the screenshots.

Salesforce Fact #614 | Remove common in flow assignment

Image
We have a 'Remove Uncommon' operator in flow assignment operation. But in case we need to figure out the uncommon ones i.e. we need to remove the common ones, we need to implement a bit of logic using loop and contains check. Attached are the screenshots.

Salesforce Fact #541 | Flow check if older version is active

Do you know there is a field in Flow list view called 'Is Using an Older Version' which denotes whether the latest version is active. If any previous version is active, this flag is true. We can filter on this flag to quickly figure out which all flows are having any previous version activated.