SOLVED

Re: Clearing SOME values from a history field - but not all?

Go to solution
Courtny_Edwards
Level 3 - Champion

Clearing SOME values from a history field - but not all?

We currently have 2 history systems capturing engagement information using appending custom text fields (one is basically an interesting moments history - we don't have Sales Insight or Sales Connect on this instance). We then use these fields within our MQL alerts to Sales.  

We are now seeing the IM History on several clients is too long, due to (now) irrelevant information, ie. no one wants to receive a MQL alert with 3, 4, 5 years of client IM history included.

Does anyone know a way to delete SOME but not all of the information in a field? We don't want to reset to NULL. We also have a separate IM field capturing the Latest IM, but we want to provide more than just the last piece of the puzzle to Sales, we'd rather show them a bit more of the journey, so don't want to only feature the Latest IM field on the alerts.

We are using a date stamp within the field value and each value is line separated, so potentially a way to delete anything before X date? or once there are 3-5 submissions within the field, delete one to add the next?

I feel like I read somewhere that a webhook could be used for this, but can't find that post now - or I dreamed it up. 

Thank you in advance for any insights.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Jo_Pitts1
Level 10 - Community Advisor

Re: Clearing SOME values from a history field - but not all?

@Courtny_Edwards ,

Use Flowboost (http://flowboost.tk/ ). 

 

You can call it from Marketo (using the Call Webhook flow step).

You can pass in fields, and then map responses back to fields

You code javascript inside the call to do the actual doing.

 

It works super well, is pretty straightforward to use, and is insanely flexibile.  I use it for a variety of tasks with one of my clients, and there is stuff I am doing that would either be ridiculously complex in Marketo, or simply impossible.  However, with access to Javascript, a lot of the things I need to do are a few lines of code.

 

If you need more help, sing out.

 

Cheers

Jo 

 

 

View solution in original post

SanfordWhiteman
Level 10 - Community Moderator

Re: Clearing SOME values from a history field - but not all?

Indeed, Jo!

 

If you’re using FlowBoost and the history field looks like this:

2021-12-15 10:10:00: Did Something
2021-12-10 11:11:00: Did Something Else
2021-12-05 12:12:00: Did Yet Another Thing

 

Then your webhook payload could be:

let currentHistoryEntries = {{Lead.History Field}};

var last2HistoryEntries = currentHistoryEntries
    .split(/\\r?\\n/)
    .slice(0,2)
    .join("\\n");

 

i.e. split on line breaks, keep only the first 2 from the top, re-join. Then map back last2HistoryEntries in Response Mappings.

 

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Clearing SOME values from a history field - but not all?

You most definitely can use a webhook-powered service for this. Split, parse the date, filter on a subset, re-join to one big text block.
Jo_Pitts1
Level 10 - Community Advisor

Re: Clearing SOME values from a history field - but not all?

@Courtny_Edwards ,

Use Flowboost (http://flowboost.tk/ ). 

 

You can call it from Marketo (using the Call Webhook flow step).

You can pass in fields, and then map responses back to fields

You code javascript inside the call to do the actual doing.

 

It works super well, is pretty straightforward to use, and is insanely flexibile.  I use it for a variety of tasks with one of my clients, and there is stuff I am doing that would either be ridiculously complex in Marketo, or simply impossible.  However, with access to Javascript, a lot of the things I need to do are a few lines of code.

 

If you need more help, sing out.

 

Cheers

Jo 

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Clearing SOME values from a history field - but not all?

Indeed, Jo!

 

If you’re using FlowBoost and the history field looks like this:

2021-12-15 10:10:00: Did Something
2021-12-10 11:11:00: Did Something Else
2021-12-05 12:12:00: Did Yet Another Thing

 

Then your webhook payload could be:

let currentHistoryEntries = {{Lead.History Field}};

var last2HistoryEntries = currentHistoryEntries
    .split(/\\r?\\n/)
    .slice(0,2)
    .join("\\n");

 

i.e. split on line breaks, keep only the first 2 from the top, re-join. Then map back last2HistoryEntries in Response Mappings.

 

Courtny_Edwards
Level 3 - Champion

Re: Clearing SOME values from a history field - but not all?

Thank you both @Jo_Pitts1 & @SanfordWhiteman  - this is really helpful, and going to be a game changer as our instance continues to grow! (also so glad I didn't actually imagine the webhook solution - ha!)