How do you use UDF's in a variable?

I am grabbing the customer Account into global.Account

I then want to use it in a {{global.account.xxxx}} ref, but cant work out the syntax to use a UDF. Please can someone advise.

image

One way to get the syntax is to change the variable to a local variable (i.e. custom.account), and then use the auto-complete to find the UDF (i.e. type {{Subscription or {{UDF and see what is displayed).

If that’s a string UDF, it will be accessed like this:

{{custom.account.[UDF:Azure Subscription ID 1]}}

For UDFs that are picklists, you obtain the value using either of these:

{{custom.account.[UDF:Azure Subscription ID 1].Value}}
{{custom.account.[UDF:Azure Subscription ID 1]}}

Picklist UDFs also have other properties available:

{{custom.account.[UDF:Azure Subscription ID 1].IsDefaultValue}}
{{custom.account.[UDF:Azure Subscription ID 1].IsSystem}}
{{custom.account.[UDF:Azure Subscription ID 1].Label}}
{{custom.account.[UDF:Azure Subscription ID 1].SortOrder}}

Thanks Travis. Ive tried to get this working to no avail. Essentially I have a value that I want to look up in the UDF. Then if that value exists add it to the existing line

Errors with the following. Any ideas?

Hey @dale ,

My apologies. Text expressions (inside {{ ... }}) and logical expressions (inside the “Expression Builder”) use different technology and slightly different syntax.

Try this (no period before the [ bracket, and quotes around the UDF name):

global.Account["UDF:Reservation Order ID"]

Also, your expression doesn’t look quite right to me. I think there is a verb missing here (maybe “matches”?):

Thanks. Yes I was missing matches

Think im almost there. I did make a mistake and missed out Matches. Is the expression correct now?

I think its not working correctly as its not finding the value in the UDF as they do match.

Does it work if you use this?

global.Account["UDF:Reservation Order ID"].Value

Unfortunately its still skipping the rule.

I can see globalReservationID is present to matches
Account exists so thats ok.
My guess is that its failing to find the reservation ID in the UDF.

UDF value shown:

image

@dale

Thanks for the new screenshot.

The expression builder doesn’t support any text replacement (you can’t use {{variable}} expressions in the expression builder). Instead, the expression builder has direct access to the variable.

The expression can use the contains or == operators instead of the matches operator, which won’t need to receive a valid regular expression. Try this for the second part of your expression:

global.Account["UDF:Reservation Order ID"].Value contains global.ReservationID

or

global.Account["UDF:Reservation Order ID"].Value == global.ReservationID

I am having a similar issue. Despite there being text in the field, the step never runs. My code is: custom.Service[“UDF:Onboarding Text”].Value != null. I have also tried it without Value.
https://www.awesomescreenshot.com/image/55775722?key=c8374e7f883cfb035d543984c04a1971

Hey @KeithTessler

Can you share the URL to an email that skipped that step even though you expected it to process? Also, tell me which rule and step should have executed.

Here is the URL MSPintegrations

The step is called Add Checklist Item. Here is a screenshot of how to find it Awesome Screenshot

Thanks for the help!

Hey @KeithTessler

I see the rule. Can you also send the URL to an email in your history that was processed and skipped this when it shouldn’t?

https://console.mspintegrations.com/#/email2at/advanced/history/17541822357970s
Feel free to rerun it as necessary.

Thanks.

The issue is that you’re testing for a UDF on a service, but the service has no UDFs (at least according to MSPintegrations). Before I dig in too much, can you confirm that your service id 206 “Adjustment.” has a UDF called “Onboarding Text”?

Yes I do