You need to sign in to do that
Don't have an account?
Jaye Lowe
Flow to remove everything after a character from long text
Hey all, here's the deal. I have a long text area, which is basically a really long url that I need to cut everything after the question mark and then copy into a URL field. Preferrably, in a declarative fashion. Any ideas?
To achieve this requirement in a declarative manner (without writing code), you can use a combination of Salesforce's Process Builder and a formula field. Here's the step-by-step process to cut the text after the question mark and copy it into a URL field:
Create a Custom URL Field:
First, create a custom URL field on the object where you have the long text area field. Let's call it "URL_Field__c."
Create a Formula Field to Extract URL:
Create a new formula field of type "Text" on the same object. In this formula field, you can use the LEFT and FIND functions to extract the part of the long text area field before the question mark. Let's call this formula field "URL_Extract__c."
Formula for "URL_Extract__c": Use Process Builder to Copy the Extracted URL:
Now, use Salesforce's Process Builder to copy the extracted URL from "URL_Extract_c" to the custom URL field "URL_Field_c."
Steps to Create Process Builder:
Object: Select the object where the long text area field and the custom URL field exist.
Start the process: When a record is created or edited.
Criteria: Use the formula condition to check if the "Long_Text_Area_Field__c" is not blank.
Immediate Action: Update records. Set the "URL_Field_c" to the value of "URL_Extract_c."
Save and activate the Process Builder.
With this setup, whenever the long text area field is created or updated with a value containing a question mark, the Process Builder will extract the URL and copy it to the custom URL field "URL_Field__c."
Hope this helps !
Thank you.
All Answers
To achieve this requirement in a declarative manner (without writing code), you can use a combination of Salesforce's Process Builder and a formula field. Here's the step-by-step process to cut the text after the question mark and copy it into a URL field:
Create a Custom URL Field:
First, create a custom URL field on the object where you have the long text area field. Let's call it "URL_Field__c."
Create a Formula Field to Extract URL:
Create a new formula field of type "Text" on the same object. In this formula field, you can use the LEFT and FIND functions to extract the part of the long text area field before the question mark. Let's call this formula field "URL_Extract__c."
Formula for "URL_Extract__c": Use Process Builder to Copy the Extracted URL:
Now, use Salesforce's Process Builder to copy the extracted URL from "URL_Extract_c" to the custom URL field "URL_Field_c."
Steps to Create Process Builder:
Object: Select the object where the long text area field and the custom URL field exist.
Start the process: When a record is created or edited.
Criteria: Use the formula condition to check if the "Long_Text_Area_Field__c" is not blank.
Immediate Action: Update records. Set the "URL_Field_c" to the value of "URL_Extract_c."
Save and activate the Process Builder.
With this setup, whenever the long text area field is created or updated with a value containing a question mark, the Process Builder will extract the URL and copy it to the custom URL field "URL_Field__c."
Hope this helps !
Thank you.