# Available variables for updating contacts - which do you know?

**URL:** <https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434>\
**Category:** General Discussion\
**Created:** [March 20, 2020, 11:19am UTC](https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434 "2020-03-20T11:19:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [March 20, 2020, 11:19am UTC](https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434/1 "2020-03-20T11:19:29Z")

</div>

Background: I try to setup some SMS related stuff. I create contacts with SMS numbers, but they have no email. Thus appear as anonymous, which they aren’t.

I know I can use **today** as a variable for day fields. What other variables are you aware of? Wonder if there is a way to reference other fiels, so I could for instance write **{mobile}@domain.com** as a placeholder into the email field via the campaign.

Are you aware of variables, that may be useful to generate something unique in this case?

---

<div class="post-metadata">

**Author:** ![captainmorgan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/captainmorgan/32/12897_2.png) [@captainmorgan](https://forum.mautic.org/u/captainmorgan)\
**Post date:** [November 29, 2023, 10:43pm UTC](https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434/2 "2023-11-29T22:43:48Z")

</div>

I’m running into a situation where I would also like to be able to use variables to update custom fields from within a campaign. Is this possible yet? Also is it possible to generate a random value in a field? My use case here is for creating coupon codes.

Thanks.

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [November 30, 2023, 9:28am UTC](https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434/3 "2023-11-30T09:28:53Z")

</div>

Hi,  
yes you can update custom fields from a campaign, but… for exactly this situation (coupon codes) we didn’t find any way to use native functions to generate them on the fly of to pull from a list of coupon codes available.

We used lowcode ([Marketing Automation with Low Code - twentyZEN](https://twentyzen.com/en/lp/low-code/)) to request (webhook) and get send a coupon code via API into the custom field.

For mailings to a given number of recipients we also imported unique coupon codes into the custom fields of those segment contacts.

---

<div class="post-metadata">

**Author:** ![captainmorgan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/captainmorgan/32/12897_2.png) [@captainmorgan](https://forum.mautic.org/u/captainmorgan)\
**Post date:** [November 30, 2023, 11:21am UTC](https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434/4 "2023-11-30T11:21:10Z")

</div>

But can you use variables in custom fields?

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [November 30, 2023, 8:43pm UTC](https://forum.mautic.org/t/available-variables-for-updating-contacts-which-do-you-know/13434/5 "2023-11-30T20:43:00Z")

</div>

No dice. Also needed it in the past. But its not supported.
