SOLVED

Selected custom object records

Go to solution
Babu_Chikati
Level 3

Selected custom object records

Hi,

I have a following use case, please suggest right approach

Customobject "UserActivity" has following data. Email is link field

email,activityTypeID,activityType,documentName,activityDate
test1@test.com,1234,vieweddocument,Doc1,2024-02-01
test1@ptest.com,2345,vieweddocument,Doc2,2024-04-10
test2@test.com,3456,vieweddocument,Doc3,2024-01-20
test2@test.com,4567,vieweddocument,Doc4,2024-05-25

I will create a smartlist with following conditions to find users whose activity is "vieweddocument" before 02/05/2024

1. Has User Activity

2. Activity date before 02/05/2024

3.Activity type is vieweddocument

 

Email addresses test1@test.com and test2@test.com will be qualified with this condition

I want to send an email for these two email addresses with their respective data record information

Question: How can I get customobject records only for these two email addresses in velocity script. Is there as way to identify these two email address custom object records and personalize the email content?

I want to send email using smart campaign

 

Thank you so much in advance

Babu.

 

Tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Selected custom object records

Seems like you’re misinterpreting what items are in a Custom Object list.

 

It’s not everybody’s Custom Objects of that type, it’s only the list of that person’s COs. You can never see somebody else’s records from inside Velocity. (Would be a huge security risk if you could!)

View solution in original post

SanfordWhiteman
Level 10 - Community Moderator

Re: Selected custom object records

Yes, you can filter the list by interrogating any property of the object(s).

 

In the specific case of stringified (ISO 8601) Dates, you can simply compare them as Strings — rather than converting them to Date or Calendar objects — to determine whether the dates are in a known range.

View solution in original post

8 REPLIES 8
SanfordWhiteman
Level 10 - Community Moderator

Re: Selected custom object records

Have you read the many previous Nation threads about looping over a list of Custom Objects?
Babu_Chikati
Level 3

Re: Selected custom object records

Hi Sanford,

Thanks for the response!

I did read your previous threads on looping through CO. I am looking for 

Instead of 

#foreach($item in $COList)

   #if($item.activityDate <= '2024-02-01')

      parse the data 

   #end

#end

Can I identify qualified emails records like

#foreach($item in $qualifiedlist)

   parse data

#end

I do not want to add a trigger whenever there is a record added to a CO. Want to use smart campaign instead.

Thank you so much for your help. Can you please point me to the thread if I missed the above discussion

 

Thanks,

Babu

SanfordWhiteman
Level 10 - Community Moderator

Re: Selected custom object records

Seems like you’re misinterpreting what items are in a Custom Object list.

 

It’s not everybody’s Custom Objects of that type, it’s only the list of that person’s COs. You can never see somebody else’s records from inside Velocity. (Would be a huge security risk if you could!)

Babu_Chikati
Level 3

Re: Selected custom object records

Thank you, Sanford!

I am on the same page with you.

  1. We can see all CO records of test1@test.com  only in velocity script If test1@test.com is qualified based on the smartlist filter criteria
  2. Need to apply a check to filter out unwanted CO records of test1@test.com in velocity script

Thank you so much!

 

Thanks,

Babu

SanfordWhiteman
Level 10 - Community Moderator

Re: Selected custom object records

What are the exact criteria for “unwanted”?

Babu_Chikati
Level 3

Re: Selected custom object records

Thank you, Sanford!

I will explain with below example to make sure my understanding is correct

test1@test.com,1234,vieweddocument,Doc1,2024-02-01
test1@test.com,2345,vieweddocument,Doc2,2024-04-10
test2@test.com,3456,vieweddocument,Doc3,2024-01-20
test2@test.com,4567,vieweddocument,Doc4,2024-05-25

 

If we write a smart list  filter for above data by activityType=vieweddocument and activityDate between 2024-04-01 and 2024-04-11,

test1@test.com is qualified which has two CO records 

test1@test.com,1234,vieweddocument,Doc1,2024-02-01
test1@test.com,2345,vieweddocument,Doc2,2024-04-10

Here CO record with date 2024-02-01 is unwanted, I was saying  this unwanted record can be filtered by checking activityDate value in velocity script because I can see CO record with date 2024-02-01 when loop through CO .

 

Thanks,

Babu

SanfordWhiteman
Level 10 - Community Moderator

Re: Selected custom object records

Yes, you can filter the list by interrogating any property of the object(s).

 

In the specific case of stringified (ISO 8601) Dates, you can simply compare them as Strings — rather than converting them to Date or Calendar objects — to determine whether the dates are in a known range.

Babu_Chikati
Level 3

Re: Selected custom object records

Thank you, Sanford!