function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DawnWolfeDawnWolfe 

Making a field populate based on another field

Hi,

 

We have web to lead forms that create leads for us.  I want to be able to have the lead source populate based on the URL the web to lead form came from.  I tried the formula below, but it keeps giving me syntax errors.....help!

 

IF((Inhouse_URL__c)="http://www.petroskills.com/EmailUs.aspx?id=8") "Middle_East_Web_Form", null)

Best Answer chosen by Admin (Salesforce Developers) 
chris.noechris.noe

Actually, you would put each new URL in the else clause of the previous if statement...Something like the following:

 

IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=8", "Middle_East_Web_Form", IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=9", "Asia_Web_Form",

IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=10", "Europe_Web_Form", null)))

All Answers

chris.noechris.noe

Try this:

 

IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=8", "Middle_East_Web_Form", null)

DawnWolfeDawnWolfe

That worked!  I have multiple URL's the lead source could be and that was just one of them.  To enter a second URL and value it could be, do I just paste it to the end of the code?  For example:

 

(IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=8", "Middle_East_Web_Form", null))(IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=9", "Asia_Web_Form", null))

 

There are about 16 different links the Web URL could be.....

 

THANKS for the help!

chris.noechris.noe

Actually, you would put each new URL in the else clause of the previous if statement...Something like the following:

 

IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=8", "Middle_East_Web_Form", IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=9", "Asia_Web_Form",

IF(Inhouse_URL__c="http://www.petroskills.com/EmailUs.aspx?id=10", "Europe_Web_Form", null)))

This was selected as the best answer
DawnWolfeDawnWolfe

Thanks!!!  Worked like a charm!