How to Implement Multi-Language Translation in Salesforce Flow

How to Implement Multi-Language Translation in Salesforce Flow

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Translation in Salesforce involves localizing and adapting the platform to support multiple languages, making it easier for users around the world to interact with the system in their preferred language. Salesforce offers several features and tools to manage translations:

    • Salesforce Translation Workbench
    • Custom Labels
    • Multi-Language Support in Knowledge Base
    • Global Picklists
    • Language Settings for Users
    • Translation API

In this blog post, I will share the different ways how you can make your Salesforce Flow to support Multi Languages.

The form you have selected does not exist.

Watch The Video Or Read The Article (Or Do Both smile)

Translate Display Text Message

For this I will create a screen flow and inside the screen, add a Display Text element. Inside the Display Text element, the message I want to display is "Welcome to Technical Potpourri". In order to display the message in multi-language (in my scenario, the two languages I am supporting are English and French), I will be using the custom label and inside the custom label put the French translation. Finally will be using the custom label inside the Display Text element. By using this techniques, my message will be displayed both in English and French language depending on the running user's locale.

Translate Input Text Element's Label

For this one, I will add the next element in the same screen flow i.e. Text element. Inside Text element's label field, I will add the text "Enter Your Full Name". Now to support English and French language for this text, I will be using the Translation Workbench. For that I will go to Setup -> User Interface -> Translate Workbench -> Translate. There I will select the below configuration and put the corresponding French translation. By using this technique, my text message's label will be displayed in both English and French language depending on the running user's locate

Translate Input Text Element's Help Text Message

To translate Text element's help text, either I can use Custom Label or I can use the Translate Workbench to translate the text. Result will make sure help text will be displayed based on running user's locale.

Translate Input Text Element's Validate Input Text Message

To translate Text element's Validate Input text message, either I can use Custom Label or I can use the Translate Workbench to translate the text. Let's assume, my validation check is, if text input contains more than 1 characte, I will consider this a valid input, otherwise I will consider this a invalid input and through the corresponding error message. First thing I will do is mark the element is mandary, and then put the logic and error message in the configuration section of the element. Finally, I will be using the Translation Workbench to put the corresponding French Translation. Again you can definitely use the Custom Label to achieve the same goal.

Translate Flow Screen's Footer Elements

To achieve this, I will be adding my second screen in the flow. In the first screen, I will be changing the text for below footer element button's as -

  • Next or Finish Button - Go To Next Page
  • Pause Button - Hold On

In the second screen, I will be changing the text for below footer element button's as -

  • Next or Finish Button - End
  • Pause Button - Hold On
  • Previous Button - Go Back

Finally, I will be using the Translation Workbench to put the corresponding French Translation. Again you can definitely use the Custom Label to achieve the same goal. 

Final Thoughts

That's all for today. I hope you will be able to handle translation requirement for your Salesforce flow's without writing any custom lwc or aura components. I will be adding more elements in this post if the way to handle the translation is different i.e. other than Custom Label or Translation Workbench. Please provide your feedback. Thank you !!

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How to Only Update Salesforce Records Using External IDs in REST API

How to Only Update Salesforce Records Using External IDs in REST API

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Before Summer 24 Release i.e. before API version 61, when you use the HTTP Patch call to do some update on record, Salesforce performs the upsert operation i.e. if the record found with matching external id, api call is going to update the matching record, but if there is no matching record with the external id, then api call is going to create the new record with the details provided in the HTTP call request body. So it is basically an upsert operation.

But after Summer 24 release i.e. API version 61, Salesforce is introducing a parameter which you can pass in the API call to make sure it will only do the update to the existing record and if the existing record not found, it is not going to create a new record. The process will stop there.

So in this blog post and youtube video, I am going to explain this powerful enhancement. Please provide your feedback what do you think about this new powerful feature. 

The form you have selected does not exist.

Watch The Video Or Read The Article (Or Do Both smile)

Pre-requisite

I have created one custom field, named "External Id" in the account object. After that I have populated the field with some values in one of the existing Account record.

Also I have configured postman to connect with my Salesforce instance so that I can perform the HTTP call from there directly. I have published a video with the steps needed to connect Postman with Salesforce org. Sharing the video below just in case you need.

HTTP Call - Matching Existing Record

I have passed the external id value as 123456789 which I know is already there in the account named Burlington Textiles Corp of America. In the body of the HTTP call, I have provided is below and the HTTP call looks like -

{
 "Name":"Burlington Textiles Corp of America",
 "Active__c": "No",
 "AccountNumber" : "ABCD1234"
}

As you can see in the above screenshot, I have added a parameter ?updateOnly=true. This is the new paramater that is being introduced in Summer 24 release i.e. API version 61. In the Path variable, I have provided SOBJECT_API_NAME as Account, EXTERNAL_ID as External_Id__c and RECORD_ID as 123456789.

Basically I am trying to update the existing record matching external id with the values provided in the body of the request. Now after executing this HTTP Patch call, below is the response, which indicates API call has successfully updated the existing record and not created any new record. If I now go to my account record, I will also notice the AccountNumber is changed to ABCD1234 for Burlington Textiles Corp of America

HTTP Call - Matching No Existing Record

I have passed the external id value as 1111 which I know is not there in any of the existing account. The body of the HTTP request is same. Call looks like -

As you can see in the above screenshot, I have added a parameter ?updateOnly=true. This is the new paramater that is being introduced in Summer 24 release i.e. API version 61. In the Path variable, I have provided SOBJECT_API_NAME as Account, EXTERNAL_ID as External_Id__c and RECORD_ID as 1111.

Basically I am trying to update the existing record matching external id with the values provided in the body of the request. Now after executing this HTTP Patch call, below is the response, which indicates API call has not found any matching record. So instead of creating a new record, the process stopped here. 

Final Thoughts

To prevent creating a new record if the target record can’t be found or doesn’t exist, add the updateOnly parameter to a URL that executes an upsert operation. You can also use URLs with the updateOnly parameter in composite REST API and composite graph REST API.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Utilizing External Clouds for Salesforce Data Storage

Utilizing External Clouds for Salesforce Data Storage

Jessica Burgess

Jessica Burgess

Technical Writer at Titan

When you get started with your Salesforce journey, it’s hard to imagine ever running out of space. As you use the tool more and more throughout your business you’ll begin to see the substantial amount of data you will store in your Salesforce org. All of this data needs to be securely stored, easily accessible, and effectively managed. You can go with the traditional on-premises storage option but these solutions can be expensive, inflexible, and unscalable. 

Enter external cloud storage solutions. These powerful storage solutions enhance your Salesforce data storage capabilities to ensure better performance on the platform, improved data accessibility, and significant cost savings. External storage clouds have a multitude of benefits on offer such as scalability to handle your growing data volumes, security features to protect your sensitive information, and seamless integration to streamline your data management processes. 

Join us as we dive into the world of using cloud storage solutions for Salesforce including best practices to keep in mind and cover a third-party software solution you can implement in your business to enhance your overall operational efficiency to support your overall growth and drive success.

The form you have selected does not exist.

Overview of Salesforce Data Cloud Storage

Salesforce cloud storage should be a pivotal component of your data management strategy. You can use a cloud-based storage solution to manage and store your data processed by your Salesforce org. When you choose to integrate Salesforce with your chosen third-party storage solution provider you can leverage benefits that your traditional storage solutions cannot offer. 

There are some things to consider when you are weighing up your options regarding Salesforce storage. We’ve highlighted two important considerations. 

Salesforce Storage Limits

Salesforce has two main storage categories: data storage and file storage. Each of these categories has its own limits which depend on your Salesforce edition and the number of user licenses you have. 

Data storage is used for Salesforce records such as accounts, leads, opportunities, and custom objects.  Typically measured in megabytes or gigabytes and is calculated on the number of user licenses. 

File storage is used for your files and attachments such as your Salesforce document storage. This includes any files that you attach to your records and content that you add to your libraries.

Salesforce Storage Costs

Although Salesforce provides substantial storage capabilities, once you exceed your limits a cost will be imposed. The total costs depend on the type of additional storage you need, the amount of storage required, and your Salesforce edition. 

To ensure you manage your storage efficiently, engage with the Salesforce storage usage report to track consumption.

Salesforce Data Storage Best Practices

Establishing effective storage management procedures and practices is crucial for maintaining the overall system performance, controlling costs, and ensuring data accessibility. By implementing some best practices you can optimize your storage usage, ensure data security, and streamline your data management processes. 

Utilize External Cloud Storage

Integrating third-party external cloud storage for Salesforce offers strategic advantages such as storage efficiency and optimized data management. Not only will you free up storage space on your Salesforce platform but it will also enhance your system performance. We recommend you implement an automated data process transfer that includes data security policies. This ensures that your data is securely transferred in a uniform manner that complies with data control regulations. Additionally, you can include access controls and encryption to further secure your sensitive data. 

Avoid Excessive Record Data

You can avoid excessive record data by following several best practices. Configure and implement data validation rules that ensure only qualified data is entered into your system. These rules prevent redundant or incomplete data from being entered into your system in the first place. Complete regular reviews and clean up of outdated or irrelevant data records that are unnecessarily taking up valuable data storage space. Salesforce does use data retention policies that archive or delete old records to keep your database looking lean and most importantly efficient.

Monitor Data Storage Usage

Keeping an eye on your storage usage is essential to avoid going beyond your allocated storage limit. We recommend you regularly review your Salesforce storage usage report to gain a clear insight into which objects and files are using up most of your storage. This usage report can assist you in taking proactive measures to ensure you never run out of storage at a pivotal moment. You can configure automated alerts when your storage limits reach critical thresholds. Tracking the trends of your usage over time helps you make strategic decisions when purchasing external storage solutions.

Backup and Restore Strategies

Backing up your data is essential for safeguarding your data against loss, corruption, or accidental deletions that can creep in now and again. Scheduling regular backups ensures that a copy of your data is available and ready to use to restore your database in case of a system failure or data breach. We recommend creating automated backup processes to ensure they run efficiently and at regular intervals. Ensure you have created well-defined data restoration procedures with designated responsibilities outlined to ensure that the correct process is followed per your company policies.

Data Security and Compliance

Data security is becoming more and more of a concern in today’s online age. You’ll need to ensure that you protect sensitive information from unauthorized access including breaches and cyber threats. Salesforce offers a variety of security features including role-based access controls, encryption in transit and at rest, and two-factor authentication that you can use to enhance your security measures. Conduct regular assessments and audits to identify any vulnerabilities and ensure that you are adhering to industry standards. Make sure that you provide training to your team members on best practices and foster a culture of transparency and security awareness to further fortify your organization's security measures.

Titan’s Cloud Storage Option for Salesforce

Titan Files is the tool you need to take your Salesforce experience to the next level. Titan Files works with Salesforce Flows to streamline your file processes and enhance user flexibility. You can connect your third-party cloud storage solution so you can archive your files according to your company’s best practices and free up that precious storage space. With Titan Files, you can store your external cloud files in Salesforce or anywhere you want.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Advanced Salesforce Formulas – Example

Advanced Salesforce Formulas – Example

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Salesforce Formulas are a powerful tool within the Salesforce platform, designed to enhance the functionality and interactivity of your Salesforce applications. These formulas allow users to perform calculations, manipulate text, and automate processes, thereby transforming data into actionable insights. They are akin to the formulas used in spreadsheet applications but tailored for Salesforce's robust CRM environment. By utilizing Salesforce Formulas, administrators and developers can create dynamic fields, validation rules, and workflows that respond intelligently to user input and data changes. This capability not only streamlines operations but also ensures data integrity and enhances the user experience. Whether you are calculating sales commissions, formatting dates, or validating data entries, Salesforce Formulas offer a versatile and indispensable resource for maximizing the efficiency and effectiveness of your Salesforce instance.

In my previous post, I have explained some of the most important formulas. So if you haven't read that blog post, you can read it below -

The form you have selected does not exist.

Now today, I am going to share some of the advanced formulas which you might need to write during your implementation. I will always keep on updating this blog post as I encounter any such advanced formulas.

Use Case 1 - Linkable Phone Number Field

Creates a phone number field that is linkable and, when clicked, calls the provided number automatically. Here, "servername" and "call" should be changed to the name of your dialing tool and the dialing command that it uses. The identification for the contact, lead, or account record is inserted in the merging field {!Id}. The dialing tool receives its phone number from the first {!Phone} merge field, and when the user clicks on the Phone field value in the last {!Phone} merge field, it becomes clickable text that can be used to dial.

HYPERLINK("http://servername/call?id=" &
{!Id} & "&phone=" & {!Phone}, {!Phone})

Use Case 2 - Round Robin Lead Assignment

Using a straightforward round-robin method, evenly distributes leads to a pool of consumers. The Lead Number field in this scenario is a custom autonumber field with a display format of {000000}. The MOD function is used to it to generate a number that alternates between 1 and the number of people in the round robin pool, which in this case is 3. You need to construct lead assignment rules based on this formula field after it has been created. You indicate the user or queue assignment for each of the formula field's values (1, 2, or 3 in this example).

MOD( VALUE({!Lead_Number__c} ), 3) + 1

Use Case 3 - Lead Age (Open Lead)

Verifies whether a lead is open and, if it is, determines how many days it has been open by deducting the creation date and time from the current date and time. The number of days open, rounded to two decimal places, is the outcome. This field is empty if the lead is not open.

IF(ISPICKVAL({!Status} , "Open"),
ROUND(NOW()-{!CreatedDate}, 0), NULL)

Use Case 4 - Consider Prev Value

This is mainly used in the validation rule. Consider when the opportunity is closed (won/loss), your business requirement is that changing the amount is not allowed and if anyone want to do that, you want to throw the error message. In this scenario, your validation rule will look like -

AND(IsClosed, PRIORVALUE(Amount) <> Amount)

Use Case 5 - Lead Score

This formula can check the completeness of the lead i.e. whether some important lead attributes are having values or not, and then based on it it calculates the score.

But you can definitely optimize the below formula as per your business logic, like when the lead's title is CEO, then add more values whereas when the lead's title is DIRECTOR, then comparatively less value.

If(ISBLANK(Title),0,5)+
If(ISBLANK(Street),0,5)+
If(ISBLANK(Email),0,5)+
If(ISBLANK(Phone),0,5)+
If(ISBLANK(Website),0,5)

Use Case 6 - Dipslay Progress Bar

I have written a blog post where Salesforce Formula and static resources can be used to display the progress bar. This is very powerful as no coding is needed and can be used in any standard or custom object. You can read the blog post below -

Use Case 7 - Case Categorization

Displays a text value in RED, YELLOW, or GREEN based on the custom field's case age. In a summary report, this formula could be used for grouping.

IF( {!Case_Age__c} > 20, "RED", IF({!Case_
Age__c} > 10, "YELLOW", "GREEN"))

Use Case 8 - Contract Aging

This formula calculates the number of days since a contract with an account was activated. If the contract Status isn’t “Activated,” this field is blank.

IF(ISPICKVAL(Contract_Status__c, "Activated"), 
NOW() - Contract_Activated_Date__c, null)

Use Case 9 - Contact's LinkedIn Profile

This formula displays contact's LinkedIn profile.

https://www.linkedin.com/search/fpsearch?type=people&keywords
={!Contact.FirstName}+{!Contact.LastName} 

Use Case 10 - Unformatted Phone Number

This formula removes the parentheses and dash characters from North American phone numbers. This formula is necessary for some auto-dialer software.

IF(Country_Code__c = "1", MID( Phone ,2, 3) & MID(Phone,7,3) & MID(Phone,11,4), Phone)

Use Case 11 - Contact's Preferred Phone

This formula displays the contact’s preferred contact method in a contact related list—work phone, home phone, or mobile phone—based on a selected option in a Preferred Phone custom picklist.

CASE(Preferred_Phone__c, 
"Work", "w. " & Phone, 
"Home", "h. " & HomePhone, 
"Mobile", "m. " & MobilePhone, 
"No Preferred Phone")

Use Case 12 - Add Business Days

This formula finds three business days from a given date. This formula finds the day of the week of the date field value. If the date is a Wednesday, Thursday, or Friday, the formula adds five calendar days, two weekend days, three weekdays, to the date to account for the weekend. If date is a Saturday, you need four additional calendar days. For any other day of the week Sunday Tuesday, simply add three days. You can easily modify this formula to add more or fewer business days. The tip for getting the day of the week is useful to use to adjust this formula.

CASE( 
 MOD( date - DATE( 1900, 1, 7 ), 7 ),
 3, date + 2 + 3,
 4, date + 2 + 3,
 5, date + 2 + 3,
 6, date + 1 + 3,
 date + 3
)

Use Case 13 - Find Difference Between Two Date/Times

To find the difference between two Date values as a number, subtract one from the other like so: date_1 — date_2 to return the difference in days.

Finding the elapsed time between two Date/Time values is slightly more complex. This formula converts the difference between two Date/Time values, datetime_1 and datetime_2, to days, hours, and minutes.

IF(
 datetime_1 - datetime_2 > 0 ,
 TEXT( FLOOR( datetime_1 - datetime_2 ) ) & " days "
 & TEXT( FLOOR( MOD( (datetime_1 - datetime_2 ) * 24, 24 ) ) ) & " hours "
 & TEXT( ROUND( MOD( (datetime_1 - datetime_2 ) * 24 * 60, 60 ), 0 ) ) & " minutes",
 ""
)

Use Case 14 - Find Business Hours Between Two Date/Times

The formula to find business hours between two Date/Time values expands on the formula to find elapsed business days. It works on the same principle of using a reference Date/Time. In this case 1/8/1900 at 16:00 GMT, or 9:00 AM PDT, and then finding your Dates’ respective distances from that reference. The formula rounds the value it finds to the nearest hour and assumes an 8–hour, 9:00 AM5:00 PM work day.

ROUND( 8 * (
 ( 5 * FLOOR( ( NOW() - DATETIMEVALUE( '1900-01-08 16:00:00') ) / 7) +
 MIN(5, 
 FLOOR ( MOD ( NOW() - DATETIMEVALUE( '1900-01-08 16:00:00'), 7) / 1) +
 MIN( 1, 24 / 8 * ( MOD( NOW () - DATETIMEVALUE( '1900-01-08 16:00:00' ), 1 ) ) )
 ) 
 )
 -
 ( 5 * FLOOR( ( MQL_datetime_c - DATETIMEVALUE( '1900-01-08 16:00:00') ) / 7) +
 MIN( 5,
 FLOOR( MOD( MQL_datetime_c - DATETIMEVALUE( '1900-01-08 16:00:00'), 7) / 1) +
 MIN( 1, 24 / 8 * ( MOD( MQL_datetime_c - DATETIMEVALUE( '1900-01-08 16:00:00' ), 1) ) )
 )
 ) 
 ), 
2 )

Use Case 15 - Horizontal Bar To Indicate Scoring

This formula displays a horizontal color bar (green on a white background) of a length that is proportional to a numeric score. In this example, the maximum length of the bar is 200 pixels.

IMAGE("/img/samples/color_green.gif", "green", 15, Industry_Score__c * 2) & 
IMAGE("/s.gif", "white", 15, 
200 - (Industry_Score__c * 2))

Use Case 16 - Case Priority Flags

This formula displays a green, yellow, or red flag image to indicate case priority.

IMAGE( 
CASE( Priority, 
"Low", "/img/samples/flag_green.gif",
"Medium", "/img/samples/flag_yellow.gif",
"High", "/img/samples/flag_red.gif", 
"/s.gif"), 
"Priority Flag")

Use Case 17 - Expected Product Revenue

This formula calculates total revenue from multiple products, each with a different probability of closing.

ProductA_probability__c * ProductA_revenue__c + ProductB_probability__c * ProductB_revenue__c

Use Case 18 - Tiered Commission Rates

This formula calculates the 2% commission amount of an opportunity that has a probability of 100%. All other opportunities have a commission value of zero.

IF(Probability = 1, 
ROUND(Amount * 0.02, 2), 
0)

Use Case 19 - Opportunity Discount Rounded

Use this formula to calculate the discounted amount of an opportunity rounded off to two digits. This example is a number formula field on opportunities that uses a custom percent field called Discount Percent.

ROUND(Amount-Amount* Discount_Percent__c,2)

Use Case 20 - Opportunity Discount With Approval

This formula adds a “Discount Approved” checkbox to an opportunity. It uses conditional logic to check the value of the approval flag before calculating the commission.

IF(Discount_Approved__c, ROUND(Amount – Amount * DiscountPercent__c, 2), Amount)

Final Thought

In this blog post, I tried to list down the most commonly used formulas in Salesforce. I will keep on adding contents as needed.Till then, please subscribe to my blog and youtube channel - technical potpourri.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments