Solved

Use dynamic input with update_property_link

  • 4 March 2021
  • 4 replies
  • 285 views

Badge +2

My company is a B2B platform that schedules events where we provide services to our customer’s employees. I would like to add an an RSVP button to our event notification emails so I can report anticipated participation to our sales teams. 

To cut down on the duplication of templates or updating buttons, I would like to use the following:

{% update_property_link 'rsvp' '2021-03-03 10:35:00 EST' 'https://www.thanks.com' %}

But instead of a hard coded timestamp, I’d like the property to be updated dynamically. 

 

Any help would be much appreciated. 

icon

Best answer by caroline 4 March 2021, 16:35

View original

4 replies

Userlevel 5
Badge +8

Hi there,

Thanks for sharing with the Community! This is a great question.

I am not sure whether the timestamp you’re looking to include is the current timestamp or the timestamp which corresponds to the event. If the timestamp corresponds to the event and the flow is triggered by an event with includes that timestamp, you should be able to reference the timestamp via the event data. Our Help Center article, “About Using Event Variables to Personalize Flows,” covers the necessary syntax.

If the timestamp you’re looking to include is the current timestamp, you can reference this timestamp via the following Django tag. You can check out Django’s documentation of this tag here.

{% now "jS F Y H:i" %}

Hope this helps!

Best,

Caroline

Badge +2

Caroline,

You’ve definitely put me on the right track, but my complete lack of experience in Django is shining through. 

Here’s the latest iteration of my attempt (I’m going for current timestamp, option 2 in your response). which is getting supplied to the url field in a Klaviyo template button block. 

{% update_property_link 'rsvp' {% now "Y m d" %} 'http://www.google.com' %}

If I decode the p= param from the href generated with the above code I get: 

{"rsvp": "{%"}7

which leads me to think it’s an escape character issue? Or there’s something about how django nests I’m not grasping. Once again, any further guidance would be greatly appreciated.

Userlevel 5
Badge +8

Hi there,

Generally you shouldn’t need an additional {% %} within the {% %} of the outer statement. So I would try the following:

{% update_property_link 'rsvp' now "Y m d" 'http://www.google.com' %}

Best,

Caroline

Badge +2

After a lot of experimenting, I’m about ready to throw in the towel. It seems that despite my best cajoling the `update_property_link` function just doesn’t want to deal with anything other than a character string as an argument.

My use case was to ensure that if an event repeated; profiles that had rsvp’d to past events could be filtered out of the current event’s rsvp list. To achieve the same effect I plan to use a simple “True” boolean passed as a string in the ‘update_property_link’ function. In the Flow logic I will schedule an action to revert all profiles’ rsvp property to FALSE after the event’s end date. 

Should do the trick ;)

Reply