Skip to main content
Solved

Is there any way to generate random Profile Property value in flows Property update step?


Forum|alt.badge.img+1

Hey! 

I’m kinda new to Klaviyo, but I have some experience in different Ecomm marketing systems.

I want to generate a random value (for example: random code for coupon), that I can send out in email during the flow steps. 

Is there any macro or something to do this, or do I have to use a 3rd party app like Make.com to get back the random value via API. It would be nice to not use any 3rd party app to do this, for a relatively easy task.

Thanks,
Greg.

Best answer by saulblum

Do the random strings need to be also saved back to some system? Do you have to ensure they are unique?

Or do you just need the ability to generate a random string of a certain length and include it in an email, and maybe save it to a profile property?

If the latter, you might be able to do some fancy django tagging, see e.g. https://stackoverflow.com/questions/10860984/random-string-in-django-template/10938877

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

DavidSandel
Partner - Silver
Forum|alt.badge.img+21
  • Partner - Silver
  • 155 replies
  • March 8, 2023

It sounds like you’re using a custom integration (as opposed to a ready-made one like Shopify), and if that’s the case, no, Klaviyo cannot handle that natively. So yes, you’d need to integrate with something else.

 

However, if I’m wrong, and you ARE using Klaviyo with Shopify (or others), then that function is already available “out of the box.”


Forum|alt.badge.img+1
  • Author
  • Contributor I
  • 1 reply
  • March 8, 2023

Hey David!

Thanks for the fast update.

We are using WooCommerce+WordPress. I can’t find any reference to do this custom coupon to Woo.


DavidSandel
Partner - Silver
Forum|alt.badge.img+21
  • Partner - Silver
  • 155 replies
  • March 8, 2023

Ah, yeah. Unfortunately, there is no easy way to do this and Klaviyo has yet to release an official or unofficial workaround. In my travels around various Klaviyo facebook groups, forums, and Zapier communities, I’ve seen some complex solutions that involve a random generator, Google Sheets, some API calls, and some other kind of action to get this to work, but I can’t remember off the top of my head, nor have I done it myself. Seems like it would be a fun one to figure out for an automation geek like me. ;-)


Forum|alt.badge.img+7
  • Klaviyo Employee
  • 169 replies
  • Answer
  • March 8, 2023

Do the random strings need to be also saved back to some system? Do you have to ensure they are unique?

Or do you just need the ability to generate a random string of a certain length and include it in an email, and maybe save it to a profile property?

If the latter, you might be able to do some fancy django tagging, see e.g. https://stackoverflow.com/questions/10860984/random-string-in-django-template/10938877