Troubleshooting - Targeting Most Recent Custom Object
Hi @sanfordwhiteman (or anyone else who has expertise in this area, feel free to reply), I recently read through some community posts about targeting the most recent data in a custom object, including this post from 2018-2019: https://nation.marketo.com/t5/product-discussions/how-do-you-access-the-most-recent-item-in-a-custom-object/td-p/79211
I also read the TEKNKL blog post https://blog.teknkl.com/tip-switch-trigger-and-batch-object/
I came to the following Velocity Script, which I tested in the Preview of the email with a relevant contact record:
#set( $dataByMostRecent = $sorter.sort($PAD_Metrics_v2_cList,"pad_load_date:desc") )
#set( $latestDataDetails = $dataByMostRecent[0] )
${latestDataDetails.pad_industry_assessment_1}
I have both pad_industry_assessment_1 and pad_load_date checkboxed in the custom object tree.
However, the email does not populate the data from the contact record for that field (it should show Network Fundamentals as the most recent data field output) - it just shows the written-out variable in the email:
${latestDataDetails.pad_industry_assessment_1}
Any ideas what I am missing or where I went wrong? Thank you in advance, I know that it's probably a question you get often.