Using Salesforce date/time fields with Pendula date formulas
Pendula supports simple date formulas within the Who are you sending it to? section of the flow setup screen, you can read more about this in Flow criteria.
These formulas allow you to trigger flows based on something which is time based-such as when the start date of an appointment is two days away, 30 days prior to a credit card expiry date or 5 days after a customer has joined your business.
A common gotcha when working with date formulas is that the TODAY() and DAYS() operators only work with date fields, not date/time fields.
Not sure of the difference? A date/time field displays a value such as 12/10/2021 2:32pm, whereas a date field would only store a value such as 12/10/2021.
This means if you want to use a formula such as TODAY()+DAYS(1) or TODAY()-DAYS(7) you'll need to firstly create a custom formula field within Salesforce which converts the date/time value into a date value.
You can then reference this formula field in Pendula in conjunction with TODAY() and DAYS() to achieve the desired result!
We've listed some steps below on how to set this up.
Salesforce has a wide range of documentation on this subject, so if you get stuck see Create Custom Fields, Build a Formula Field and Create Formula Fields for more information.
How to create a date formula field in Salesforce
- Navigate to Setup within Salesforce and select Object Manager
- Use Quick Find to search for the object you are referencing within the flow and click on it
- Click on Fields & Relationships, and click on New
- Select Formula as the Data Type and click Next
- Enter a name in the Field Label field and select Date as the Formula Return Type
- In the formula field box, type in DATEVALUE(insert date/time field api name here). You can use the Insert Field button to help you enter the correct value. This formula will take the value in the date/time field you have entered, and convert it to a date only value.
- Click on Check Syntax to confirm your formula is formatted correctly
- Click Next and continue any required steps to create your new formula field
- Once created, reference this field in the Who are you sending it to? section of the flow setup screen, rather than the equivalent date/time field for any date formulas using TODAY() or DAYS(). You may need to refresh Pendula first in order to recognise the new field.
Hope that helps! Post any additional questions as a comment below.
Please sign in to leave a comment.
Comments
0 comments