Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [if]

The tag has no usage guidance.

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

Display no content if the condition is not met AMP script

I'm trying to build a dynamic email with different blocks displaying based on the if/else check. I can't understand how do I display nothing and go to the next step if the condition is not met. Here ...
Mikhail's user avatar
1 vote
1 answer
41 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, ...
Shanaya's user avatar
  • 13
0 votes
1 answer
183 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 ...
Bill Beatty's user avatar
0 votes
2 answers
104 views

IIF statement giving error

I am super new to using AMPScript and have been watching some videos and browsing this forum and have been putting in the exact same IIF statements but I have been getting this error: The subscriber ...
rnkwill's user avatar
  • 15
0 votes
1 answer
109 views

Is there a way to process SQL queries in Salesforce Marketing Cloud based on criteria in another unrelated table?

I have a set of steps that I want to process in Salesforce Marketing Cloud, but I'd like to make it easier for my users. I have a set of steps I want to run if a column is "True" and a ...
Greg Whitaker's user avatar
0 votes
1 answer
64 views

Warning Error when encoding row-level formula: Syntax error. Missing '='

I don't know what is wrong in the formula bellow:
luisa anjos's user avatar
0 votes
0 answers
94 views

Row level formula: Pull value between two dates

I am trying to make a row level formula to identify dates that are in Q1 (Sep, Oct, Nov) of two years of fiscal data. I am able to distinguish between FY23 and FY24 using IF(Case.End_Date__c > DATE(...
Camille_03's user avatar
-2 votes
2 answers
39 views

Add a "0" to the left of the postal code

I would like to put a formula in a flow to update the postal code if it only contains 4 characters. All my postcodes must be 5 characters long so I would like to add a 0 to all the postcodes that are ...
WizeQuestion's user avatar
0 votes
1 answer
63 views

Nested IF CONTAINS AND Formula - results not returning correct answers - What am i doing wrong?

I am looking to return the values to an Expected Revenue column, based on the WEB FORM CAMPAIGN field having specific words in. The campaign names are set up like the following, so I am looking for ...
Rob Boyton's user avatar
0 votes
1 answer
50 views

How to test two conditions in formula field IF

So I'm stuck on the logic here this was my original code and it worked but I was also trying to add a condition that if TODAY()-LLC_BI__Covenant2__c.LLC_BI__Next_Evaluation_Date__c) > 0 is true ...
Albert Chen's user avatar
0 votes
1 answer
93 views

issue with UpsertDE "Unable to retrieve security descriptor for this frame"

I'm trying to write results in a Data Extension but this is the message response in the cloud page {"message":"Unable to retrieve security descriptor for this frame.","...
Juan's user avatar
  • 1
1 vote
2 answers
2k views

lwc:if and lwc:else directive not working

child cmp html <template> <!--Edit Mode--> <template lwc:if={_isEditable}> <input type="number" step="1"></input> <button> {...
Gargi Gupta's user avatar
0 votes
1 answer
661 views

Using ampscript check if value exists in data extension

I have a customer_data_extension that consists of customers with their customer_id. I'm creating an email with conditional content, so IF customer exists in customer_data_extension then show this ...
T01's user avatar
  • 9
-1 votes
1 answer
964 views

Formula field to evaluate two fields separately and returns a value based on one or the other values

The formulas work separately but I need the formula to evaluate the formulas in a "or" situation. IF I use & for the first formula - it concatenates the field but I want a Closed Or an ...
Jo Anne's user avatar
0 votes
2 answers
43 views

Struggling with syntax errors on and IF AND statement

I seem to always be struggling with resolving syntax errors on my IF code. I have used VS editor so it's easier to read and I don't think it's a parenthisis issue. Getting the error message "The ...
Samridhi's user avatar
0 votes
1 answer
575 views

Multiple IF AND ELSE statements

I am trying to create a formula with several specific requirements to calculate call contact rates. The first IF section of my formula works on its own, however adding the additional IF statements ...
Mike's user avatar
  • 1
-1 votes
1 answer
77 views

CASE or IF - how to create a formula field with several IF?

Im a bit confused in creation formula to calculate field Source on Case. the task is : On Case create formula to calculate the following: For users with country US show Account Source if Account ...
Alina vashchenko's user avatar
0 votes
2 answers
708 views

AmpScript redirect not working in if/else

Hello I'm working on a Cloud Page in Marketing Cloud. I'm trying to set a redirect based on the result of an object update in a connected CRM. Example code below. %%[ var @campaginMemberId, @city, ...
banjug's user avatar
  • 29
0 votes
1 answer
116 views

Incorrect IF formula : expected 3, received 4

I need to add some lines into a formula and I started it but I'm stopped with the following issue : Incorrect number of parameters for function 'IF()'. Expected 3, received 4. I saw there's another ...
TDFR's user avatar
  • 1
0 votes
1 answer
63 views

If / then to set an Id - Invalid id

The below code is an attempt to push some child objects my code creates into a master opportunity. Not all Opportunities will be children, hence I want to do a check. TargetOpid is the variable I want ...
jaw999's user avatar
  • 1,315
0 votes
2 answers
645 views

Checkbox formula not working

I am trying to select a checkbox if, "Connected" is in the disposition and the call sentiment field does not have "Gatekeeper". My formula isn't working: IF( AND( CONTAINS(...
user123970's user avatar
0 votes
3 answers
791 views

Multiple If Statements for a merge field for a HTML Email Template

I am trying to create a conditional formula for a merge field for a HTML Email Template with the following logic; IF both ICMS ID and Portal ID are present then only show ICMS ID OR IF only ICMS ID is ...
asidrey's user avatar
  • 79
0 votes
2 answers
999 views

render child component div in lwc by matching data-attributes on button click

I have a component that displays a list of questions using a for:each. For each question rendered I have a child component (which is a simple form with a few fields) to capture a followup question. I ...
swat's user avatar
  • 5
-2 votes
1 answer
142 views

Formula on contact to see if the first name is only 1 character long [closed]

We currently have a formula text field with the below formula: IF( FirstName =".", text(Salutation) &" "& LastName , FirstName ) but we want to add that if the first name ...
Benjy Hunt's user avatar
-2 votes
1 answer
323 views

Multiple OR for one variable and with AND CONDITION [closed]

How to write this code If @br != 'X' OR 'Y' OR 'Z' AND @PROF=='N'
Seo's user avatar
  • 1
1 vote
1 answer
401 views

Insert or update campaign member after if condition

I'm trying to check if a campaign member has already been entered in a campaign in case affemative update the status otherwise enter the member. This is my code, but currently it doesn't work very ...
Toris's user avatar
  • 17
1 vote
2 answers
3k views

What is the best way to replace the if true condition in LWC

I know that we can't write a specific condition in <template if:true={specificcondition}> LWC HTML file. However what is the best way to implement next HTML code : <template for:each={...
user avatar
-1 votes
1 answer
688 views

Get a value from a string with If condition

I am trying to obtain a value from a string if something is true in the string, example: I have the following String String str1 = "{\n\"test1\": \"132456789\",\n\"...
Willy Kelly's user avatar
0 votes
1 answer
5k views

Need help using IF statement in Salesforce Flows

We're moving to Flows and I need a bit of help on IF statements in Salesforce. I've tried a few variations but with the IF statement when creating a DATE formula but I keep getting “Syntax error. ...
Samridhi's user avatar
0 votes
1 answer
357 views

Formula within a flow - loads of 2 part IF statements - must be a better way of doing this

I'm new here but the questions and answers here have helped me before so thought I'd try posting. I'm trying to use a boolean formula that will be referenced in a flow. The idea is to update a ...
Matt's user avatar
  • 61
-1 votes
1 answer
335 views

IF Formula help - Multiple Parameters Issue

Im new to salesforce formulas and need to implement this new field (New_License_Manager_ID__c) into the formula. I received an Error: Incorrect number of parameters for function 'IF()'. Expected 3, ...
NewbieSF's user avatar
-1 votes
1 answer
600 views

IF Ampscript - if a record from one data extension exists in another

Is there a way to write an IF ampscript to say: If records from Data extension A, exist in Data extension B, then display 'Welcome Back' ELSE display 'welcome'?
Preksha Rathore's user avatar
1 vote
1 answer
1k views

problem with switch case

I share with you my code which appears to work well the problem I have is that: If for example, I choose the status as closed and I choose dates, I can't save and that's what I want, but when I try to ...
salesforcedev's user avatar
0 votes
1 answer
258 views

Test class data missing?

I have a couple of days with this test class. I added already all data necessary for my test class, but I'm getting only 69%. The problem is on the all "if", when I test my test class Its ok,...
Alex Barón's user avatar
0 votes
1 answer
557 views

formula field condition

I want to express this condition with my new formula type field that returns text Green Flag: is still valid Orange Flag: 1 year approaching its end. Red Flag: no longer valid so exceeds the "...
salesforcedev's user avatar
0 votes
1 answer
3k views

Formula problem with Multiple Condition

I need help please, I created two fields, the first is "Group" of text type and the second is "status" of formula type The status must check the condition of If Group contains '9','...
salesforcedev's user avatar
0 votes
1 answer
548 views

Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2

The title says it all. I know I am missing my 3rd parameter per the error, but I can't determine where. IF ( Not_Final_Destination__c = TRUE, IF (AND(SCMC__Customer_Account__r.ShippingCountry <&...
Scott Hendrix's user avatar
1 vote
2 answers
2k views

When the if condition is true it still prints else condition statement

Hope guys are doing well. I'm a newb and still learning javascript. My if condition isn't working, I created a simple if-else loop (if any condition is met it should print following conditions ...
Prince Sharma's user avatar
0 votes
1 answer
664 views

Alternatives for multiple If statements

I need to compare the fields and depending on that if its true then update a boolean variable and if its false then capture this field and get the label and append it to a string. I have like 10-12 ...
Raham's user avatar
  • 43
0 votes
1 answer
132 views

Render code if condition is true

I want to render the span syntax only if the wrapper.AccHead is not empty. I tried the code below, but it does'nt work. I tried also to use the rendered syntax in span but it does' nt work. Is there a ...
Rag21's user avatar
  • 105
1 vote
1 answer
14k views

Adding conditional logic (IF, THEN) in Salesforce HTML email templates

I'm struggling with adding IF, THEN conidition to my HTML Classic Email template and hoping someone can help. I am trying to say if Cohort Owner's name is 'X', then post the X link, if Cohort Owner's ...
Samridhi's user avatar
0 votes
2 answers
211 views

Aura Redirect Component Only if CustomerID is not Null

I wrote code for an Aura Redirect Component but I'm having trouble getting it to redirect only if the CustomerId is not null. Here's my code. Apex Controller public with sharing class NetsuiteQuote { ...
Laura Bejjani's user avatar
0 votes
1 answer
37 views

Why this set does not contain my data?

I have this data: Account.Zone__c = 'A'; Zone_set = '{ B, A, C}'; if(!Zone_set.contains(Account.Zone__c)) { //do this } Account.Zone__c = 'B'; Zone_set = '{ B, A, C}'; if(!Zone_set.contains(Account....
CPS's user avatar
  • 345
0 votes
0 answers
249 views

I want to create a Text String in a Parent Object of Multiple Products sold on a specific Opportunity using a Formula Field - Help?

Parent Object - Opportunity Child Object - Opportunity Product I have a field for each product on the Opportunity. For example if Opportunity Products X and Y were added to the Opportunity as ...
kikalz's user avatar
  • 39
0 votes
0 answers
20 views

How to get code coverage for independent if conditions in for loop using test class in salesforce? [duplicate]

I need help to get 100% code coverage for below trigger.This trigger will prevent me creating duplicate record. trigger DuplicateTriggerReseller on Reseller_Details__c (before insert) { for(...
Ghouse's user avatar
  • 1
-2 votes
1 answer
948 views

HOW TO Avoid three or more nested LOOPS [duplicate]

for(String objectName : jsonMap.keySet()){ // List<map<String,String>> listObjects=jsonMap.get(objectName); List<Map <String, String>> ...
ABC's user avatar
  • 1
3 votes
1 answer
5k views

Changing the colours of the fields depending on a formula?

I have two number fields on opportunity layout. A and B. I want to create a formula field and when A>B the formula field will be red or just an indication that people will notice it right away when ...
Nathan's user avatar
  • 45
0 votes
1 answer
5k views

IF ISBLANK FORMULA

I'm trying to get a validation rule to check a Date Field called Triage_Stop_Time and if there is a value in the field it will make my Billing Picklist required with an error message "Required&...
ETM's user avatar
  • 3
0 votes
1 answer
71 views

Formula field with 4 IF statements and 2 False statements

I need to make a formula field work, unfortunately, I cannot figure out how to place statements so that I can include 2 False options (False options have been bolded) The logic behind the formula: If ...
kikalz's user avatar
  • 39
0 votes
1 answer
330 views

Help with nested IF statement with images

I have a field "Account__r.Commission_Rate__c" and depending on the value of this % field, I want to show a coloured flag. If the % is 0-5, the red flag needs to display. If the % if 5-10, ...
1918721's user avatar