custom field pulling from activity object - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Patrick FranciottiPatrick Franciotti 

custom field pulling from activity object

I have a field for "Last Engaged Date" on the account. What I want to do with this is check the activity history on any given account, find the last "IN" email (IN is in the subject of the task record), and the populate that due date of the IN email onto the "Last Engaged Date".

 

I've attached my current build but would love some input - thank you!User-added imageUser-added imageUser-added imageUser-added image

Best Answer chosen by Patrick Franciotti
Micah PerryMicah Perry
Oh. Instead, change that Object from Account to Contact (and change the name of the element from "Get Account from Task" to "Get Contact from Task") and set your filter condition to Id equals $Record > WhoId.

Then in your Update Records element, set your fitler condition to Account Id equals Get_Contact_from_Task > Account Id.

All Answers

Micah PerryMicah Perry

First, in the conditions for your Task, I'm unfamiliar with what you're doing with the subject line. As far as I know, you can't add multiple texts with those brackets for it to search on. The way it's written, it's going to literally look for a task with a subject that contains "[Outreach] [Email] [In]" in the subject in that specific order, with those brackets. Unless I missed something in one of the releases.

Secondly, we need to identify which account should be updated (I assume you want the account that the task is created on). Since the Task object will only provide us with the Id of our account through the WhatId (shown as "Related to" on the record, you'll want to edit your  Update_Last_Engaged_Date Update Records element where it says "Filter Account Records" to update an Account where the Account Id equals the $Record > WhatId.

Then you'll want to connect the Start element to your Update Records element.

Patrick FranciottiPatrick Franciotti

Thank you Micah. The "[Outreach] [Email] [In]" is an automatic format we have applied to all inbound emails that are created through another product (Outreach) - hence the wording. So I know that part will work no problem.

 

That makes sense on the 'What ID.' But currently these tasks that are being generated automatically only autopopulate the "WhoID" (Name field) within the task.

 

I guess my first step should be trying to figure out how to pull the AccountID of the WhoID, and then populate that AccountID onto the 'Related To' field. And then I think this should work no problem.

Micah PerryMicah Perry

If the Account is the record that the Contact in the WhoId is connected to, then you may need to first drag a Get Records element on the canvas and get an Account where the Account Id equals the $Record > WhoId > AccountId. and then connect your Start element to the Get Records and connect the Get Records to your Update Records element.

Then, in the Update Records element, update the filter criteria to be where the Account Id equals Get Records > Account Id.

Patrick FranciottiPatrick Franciotti
That sounds right, but I don't have the option to pull AccountID from WhoID (screenshot).User-added image
Micah PerryMicah Perry
Oh. Instead, change that Object from Account to Contact (and change the name of the element from "Get Account from Task" to "Get Contact from Task") and set your filter condition to Id equals $Record > WhoId.

Then in your Update Records element, set your fitler condition to Account Id equals Get_Contact_from_Task > Account Id.
This was selected as the best answer
Patrick FranciottiPatrick Franciotti

Thanks Micah! This works flawlessly. Thank you so much for your help on this - I really appreciate it. This has been a crucial step in a much larger process at my company so this is a big step!

User-added image

User-added image

User-added image

User-added image