How To Use Computed Fields To Convert Text To Dates In Lead Prosper
When collecting lead data, you may sometimes get text-based time references like “Less than 6 months” or “Less than 2 years” instead of an actual date. While this may be fine for capturing intent, it’s not very useful if you want to pass along or store a precise date value.
With Lead Prosper’s Computed Fields, you can solve this problem by chaining together two transformers:
- if_else – to replace the incoming text with a relative date string (like “6 months ago”).
- date – to convert that relative string into an actual date value.
Example Use Case
Let’s say you are collecting an incident_date field in your MVA campaign:
{{incident_date}} = Within 2 Years
The field may contain values such as:
- Within 30 Days
- Within 3 Months
- Within 6 Months
- Within 1 Year
- Within 2 Years
- Over 2 Years
Instead of leaving these as vague text entries, we can map them into precise dates.
Step 1 - Create the Computed Field
The first step is to create a Computed Field, which can be done either from the Campaign Page under Computed Fields, or within the Buyer set up itself:
Campaign Page:

Buyer Page:

Step 2 - Add The Campaign Field
The next thing to add is the initial campaign field that you are grabbing the text value from. In our example this will be the field {{incident_date}}.
To add the Campaign Field, select the + sign at the far right and select the field.

Step 3 - Add Your Transformers
Once the Campaign Field is added you are going to need to add transformers. To do so you’re going to start by hitting the orange + button by the campaign field’s name. This will cause the Transformers area to appear.
Add if_else Transformer
First we will add the if_else transformer to convert the text values into a relative date string that can then be used to get the estimated date.

When the if_else transformer is added to a campaign field that is set up as a Multi Value List the system will automatically populate the FIND & REPLACE table with your list of allowed values for that field.
Under the Replace column you are going to add the relative date equivalent, in this case it would be something like:
| FIND | REPLACE |
| Within 30 Days | 30 days ago |
| Within 3 Months | 90 days ago |
| Within 6 Months | 6 months ago |
| Within 1 Year | 12 Months Ago |
| Within 2 Years | 18 Months Ago |
| Over 2 Years | 24 Months Ago |
Add date Transformers
Next we need to add the date transformer that is going to provide us with a date based on the replaced relative date values we just added above. Find the date transformer in the list of transformers to the left, and after you add it go to Output Format, hit the +, and then select the date format you require.

Hit Save, and when you are ready to test your transformers you can hit Test Output to get a sample output of how the values derived from the Computed Field will look.

Step 4 - Add Your Computed Field to Payload
The last step is to add your Computed Field to your buyer or campaign trigger payload. You can add it in-line by entering {{ to bring up a list of all fields and type the name of the computed field. Or you can hit the "fields" button in the toolbar to activate the field list breakdown, and the first item will be a list of all computed fields for that campaign.

Computed fields added in the payload will appear highlighted in green, and if you hover over them you will see a quick view of the computed field configuration so that you can review the set up and values.
And that’s it. Your new computed field is set up to convert the text values that are collected into actionable dates that your buyer’s system can accept. By applying the if_else and date transformers, you can turn vague text inputs into precise, formatted dates that are easy to work with. This approach not only standardizes the data you collect but also makes it more valuable to your buyers, who often require exact dates for compliance and decision-making. And because Lead Prosper lets you tie multiple transformers together within Computed Fields, you have the flexibility to keep refining your data from left to right until it’s in the perfect format for your campaigns.