---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://www.servicenow.com/docs/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Setting field values from the email body

# Setting field values from the email body {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Values in an inbound email can set field values in a task record.
Any name:value pair in an inbound email body gets parsed into a variable/value pair in the
inbound email script. The name:value pair must be on its own line. Note that most email
clients limit the number of characters allowed per line and may truncate excessively long
name:value pairs.  
Tip:  
To prevent unexpected parsing, ensure that all the names in the name:value pairs are unique.

See [Redirecting Emails](https://www.servicenow.com/docs/Z0p85cvkKaKYhWcYpjut7w "Configure other mailboxes to forward email to the instance's POP3 account.") for an example of using setDisplayValue()
in an inbound email action.  
Note:  
The action always generates a lowercase variable name. Also, this functionality does not work on reference fields.  
For example, if an email body contains this line:

    Foo:bar

The inbound email script creates the variable <var class="keyword varname">email.body.foo</var> with the value of bar. You can use these variables to create conditions such as:

    if(email.body.foo!=undefined){
       current.[field]=email.body.foo;}

In this example, the script sets the value of <var class="keyword varname">[field]</var> to the value bar.  
Note:  
Spaces are rendered as underscores when a name:value pair gets parsed into a variable/value pair. For example, if an email body contains a line with spaces like <kbd class="ph userinput">my variable:data</kbd>, then the inbound email script creates the variable <var class="keyword varname">email.body.my_variable</var>. The value of the variable is data.

