Questions tagged [formula]

A formula is an algorithm that derives its value from other fields, expressions, or values. Formulas can help you automatically calculate the value of a field based on other fields (from Salesforce doc). Formulas can be used in many areas of Salesforce other than just Formula Fields, such as Validation Rules and criteria for Workflow Rules and Approval Processes.

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

Could you please help me to write a formula Salesforce

Coud you please help? I need convert this SQL code to Salesforce Formula left(Price_Lookup_Id, case when charindex(':', Price_Lookup_Id) = 0 then len(Price_Lookup_Id) else charindex(':', ...
0 votes
1 answer
50 views

Formula to check if field value is changed and not null in Flow

I'm adding a formula variable in flows where I need to update a record if Field A is changed and also should not be null. This is a before save flow and runs only on update records. I tried below ...
0 votes
2 answers
332 views

Salesforce ISCHANGED(field) Documentation

Is there a FORMULA FUNCTION that is case sensitive? ISCHANGED(field) is not a case sensitive function I found from testing (Documentation is pretty vague on that). Is there a FORMULA Function that ...
0 votes
1 answer
1k views

Declarative way to determine what group a user belongs to

Without using apex is there a way to find out what group(s) a user belongs to. Looking to build a declarative case assignment rule based on certain groups a user belongs to. Maybe using a formula ...
0 votes
1 answer
45 views

Set a custom checkbox field to TRUE based on another checkbox field value and a text field value

I need to set a custom checkbox field to be TRUE based on the values of two other custom fields. The new checkbox field is named 'Is_International_Student__c'. The existing fields are a checkbox ...
0 votes
1 answer
989 views

Validation rule that restricts a status change based on the value of another field

I have a picklist on account, one of the values is "active" and another is "proactive". I have another field called "account minimum" (number field). In order for the ...
0 votes
1 answer
2k views

truncate the value to a specific character

How do I write the values from the email field only after the @ symbol into the custom lead field ? which formula should I use?
1 vote
3 answers
3k views

Formula Question: Record a date of first activity on contact object

I need to create a custom field on my Contact object that records the date of the very first call that has happened with a Contact record. I thought about creating a formula field on Contact, and ...
3 votes
1 answer
2k views

Is it possible to evaluate a Salesforce formula in Apex?

I want to do something dynamic with an Apex method. I have some custom metadata records that contain an object and field definition. I want to inject the field value from the object into a custom ...
0 votes
2 answers
700 views

Feb 29th error on formula for datetime field

I have a formula that is throwing up the 29th feb leap year error etc but for the life I cant see why? The error message is "Computed an invalid date, such as February 29th on a non-leap year. ...
1 vote
1 answer
2k views

Formula to update multi-picklist with Salesforce Flow

The requirement I have is that a multi-picklist (MSP) field ("Specialty") is updated based on any additional values from another multi-picklist field ("Specialty Marketing") with ...
0 votes
1 answer
831 views

Includes does not work with multi select picklist in flow formula

I created a record triggered flow and tried to create a formula which can check for a multi select picklist which I can use later in the flow. The formula is like this - IF(INCLUDES( {!$Record....
0 votes
1 answer
802 views

How to create a formula to output a number for a picklist value, and reject an N/A value?

In creating a formula to stamp the numerical value of a picklist, I am having difficulty with an "N/A" value. Right now, the picklist has 0,1,2,3,4,5,6,7,8,9,10,N/A as options to choose from. I am ...
3 votes
3 answers
3k views

Displaying date/times in report

I want to display the Date AND Time a document was created in a report. By default, Salesforce reports only display the Date portion of the "Created Date" field. Is there a way to get the Time ...
0 votes
2 answers
47 views

Formula field syntax exceeds character length limit

I have the following formula field that uses nested if statements: IF ( AND ( NOT(ISBLANK(Last_SMS_Sent__c)), NOT(ISBLANK(MobilePhone)), NOT(ISBLANK(...
0 votes
1 answer
43 views

Syntax Error - Summary Level Formula

Baby SF user here, I cannot get past this Syntax error saying I am missing a ')' in this formula: ( ( SUM( CASE WHEN BucketField_77200030 = 'Promoter' THEN 1, ...
0 votes
1 answer
7k views

URL in Flow Screen open in same window but new Console Tab

I am creating a Flow that will only be shown to Users within a Lightning Component on a Lightning Page. It cycles through a lot of loops and eventually displays a list of records with some other ...
0 votes
1 answer
25 views

Trying to write a Flow formula using a picklist field. Whenever a stage changes in the Opportunity the probability must change with it

Here is the Formula I have created. I am stuck because I keep getting an error stating too many or not enough ( or Field StageName is a picklist field. Picklist fields are only supported in certain ...
0 votes
1 answer
63 views

Calculate hours between 2 date/time fields excluding weekends adapted for different timezones

I am stuck with an issue with editing Salesforce formula for counting business hours between 2 dates (provided by Salesforce here): ROUND( 8 * ( ( 5 * FLOOR( ( DATEVALUE( date/time_1 ) - DATE( 1900,...
0 votes
1 answer
2k views

How can i get Account id in Lead object for Formula

Firstly i need the write query in mailchimp entegration for salesforce contacts and leads, in this case i will get 1 checkbox situation. with formula but in leads i dont have lookup for account rather ...
0 votes
1 answer
47 views

Nested AND/OR Statement in a Validation Rule on the Case Object

I've tried following other resources, but decided to share this one to see if anyone could help me get the syntax correct: I need to display an Error message on the Case Record when someone tries to ...
10 votes
2 answers
1k views

Field filter does not Work for Text Formula field used in SOQL

I have a simple SOQL query on Account which has a field Full_Address__c which is joint of Billing Street, City Zip. When I use this field as a filter it doesn't return the records: Example: String ...
1 vote
1 answer
36 views

Help with Formula Field - IF & LEFT Functions

Newbie here. Would appreciate all your help. I'm trying to write a formula for the following Scenario: Field Name - "Course Interest" has Certificate I, Certificate II, Certificate III, ...
0 votes
0 answers
39 views

Formula in Classic Email Template ISBLANK

I am trying to return custom text when a field is blank in my record using a classic email template. I am pulling my hair out. I have searched high and low with no luck. I am using this formula in the ...
0 votes
1 answer
895 views

Extract specific string in between 2 characters using Salesforce formula

I want to extract the time in this below chat transcript body field. Below is the sample value in Chat Transcript Body field : And I want to take the value 13s <p align="center">Chat ...
-1 votes
1 answer
22 views

Update Checkbox Formula Field - Case?

I am trying to make a checkbox formula field on a custom object using a CASE function to set the value. There are specific entries in a text field that I would like to set the new checkbox to true, ...
0 votes
1 answer
40 views

Nested IF statements, second IF Statement is not working

I have nested IF statements, and the first IF statement is correctly returning "Yes" when a record type does not have all of the values present, but the second IF statement - written the ...
1 vote
1 answer
1k views

How to get Formula Description for LWC

The "MailTempRenewalHosyuStart__c" in Contract object is formula of text. I wrote as below. "★Detail★ "&BR() &BR() &( Field4__r.Name) &BR() &TEXT( C__Contact__r....
3 votes
2 answers
1k views

Hyperlink formula field not visible in List view for lightning

I have one hyperlink formula field- HYPERLINK("/apex/Submit_Forecast?id=" +Id & "/view", Name ) I added this field in All list view of object. It is working fine in salesforce classic but ...
0 votes
1 answer
69 views

Formula Field Case Statement that is dependent on a picklist value

I am trying to edit a formula field and make the Case Statement dependent on the value of a picklist, namely an account TYPE. I know an IF statement takes 3 arguments, but the following is the gist of ...
-1 votes
1 answer
57 views

A way to track time spent on a custom Stage/Picklist in a custom Object

I'm helping in a Org that isn't using the Opportunity Object, they have a custom Object for this scenario. One of the fields is a picklist named "status" that is referenced by the Path at ...
0 votes
1 answer
1k views

Account formula field to get the latest opportunity / quote contact name?

An odd request, I know. What I'm looking for is a formula on the Account object that grabs the most recent Contact name that is assigned to an opportunity / quote. Is this possible with a formula or ...
0 votes
1 answer
59 views

Calculating Percentage using Case(Text(TERR2_NAME:UNIQUE

I have a valid summary formula that I am attempting to incorporate into my dashboard to show percentages based on what is in the system and how many records should be in the system. My formula is: ...
-1 votes
1 answer
26 views

Use a formula that returns text, concatenating a number field

I have the following problem: I need to use a formula in my flow, which will be for my description field, text should appear in it and concatenate with a number type field. I receive the following ...
-1 votes
2 answers
4k views

Summary Level Formula - Sum Closed/Won Opportunities

I am using Lightning and trying to build a summary level formula field to show the sum of closed/won opps next to the sum of total opportunities for a given time period (fiscal quarter for example). ...
0 votes
1 answer
39 views

Change color of standard salesforce images samples

I would like to know if it is possible to change the color of this type of image /img/samples/color_yellow.gif I would like to use other colors, such as blue or orange
0 votes
3 answers
6k views

Formula for calculating number of hours between 2 Date/Time fields

Problem: I am trying to figure out the time in hours it takes for a Lead to be contacted after the Lead record is created Steps Taken: 1- Created a custom read-only Date/Time field called ...
0 votes
2 answers
3k views

How do I remove all text and characters from a Text field except 0 - 9

I have a Custom Mobile Phone field where we only want to see numeric characters Is there a way to remove all text except 0 through 9? I have a Substitute formula that removes (, ), -, _ etc but we ...
0 votes
1 answer
3k views

LEN() formula in Flow Builder not working as expected

My formula as seen in the screenshot is not working. Essentially I'm trying to accomplish "If the length of characters input into this field is greater than 255"
0 votes
1 answer
798 views

validation rule only one user profile can edit status when status is Approved

I have Validation Rule AND ( $Profile.Name <> "System Administrator", TEXT(Approval_Status__c) = "Approved" ) I need that only System Administrator can edit Receipt when ...
0 votes
2 answers
2k views

Updating a Date Field with Last Day of The Month based on another Date Field

Updating a Date Field with Last Day of The Month based on another Date Field. I need to write a formula to do a field update when an Implementation is complete. Basically once it's marked as ...
0 votes
1 answer
912 views

Formula field not showing value between 2 related object

I have 2 objects Contracts - Custom Sales Submission (Opportunity Process) - Custom They are related because of Lookup relationship. GOAL: I want to show in Sales Submission Object that when the ...
0 votes
1 answer
846 views

Issue with Lightning Dashboard formula

I have a report which is grouped using a custom field called Type__c. It holds two values, RN and NB. Now, I have created a formula in the lightning report to get the percentage of each record count. ...
1 vote
1 answer
2k views

Stage conversion report for each and every Sales person

I want to create a report on Stage conversion percentage of opportunity per sales person. Like if a salesperson have 10 Opps in first stage and only 6 forward to second stage then from 6 only 4 ...
2 votes
2 answers
814 views

LastActivity on Case Object

I need to populate a date on the case object that has the Last Activity date recorded. I tried to make a date formula on the case object, but cannot find the LastActivity API to pull it through. Is ...
-1 votes
2 answers
69 views

Syntax error. Missing ')'

I'm trying to create a validation rule but it's erroring due to a missing parenthesis. Plan_Required__c = "Naked Fibre" && NOT(Selcomm_Internet_Plan_ID__c, "906", "...
1 vote
1 answer
20 views

Collection Filter formula unable to use TEXT() to convert Picklist value to Text value

Receiving unexpected error when debugging a subflow that uses a Collection Filter with formula referencing a picklist using TEXT(). Oddly enough, this validates successfully inside the subflow, but ...
0 votes
2 answers
1k views

How to change image url to Image Logo in rich text custom field.?

I need help to understand how to change the URL value to the image logo. I have a custom field called image URL datatype (RichText), I would like to convert my image URL to an image logo. can you ...
0 votes
2 answers
1k views

Check if the case owner is a user or queue before changing status

I want to write a validation rule that the case owner should only be a user and not the queue before changing the case status to 'Assigned'. I wrote the following formula but it is not working: AND( ...
0 votes
1 answer
405 views

Rounding Issue on formula field calculating business hours between two dates

I have the following formula and even though the formula field is set as a number type and has 2 decimals set, the below formula is still rounding up to a whole hour. I can not figure out how to get ...

1
2 3 4 5
37