<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="en-CH" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In the resource, the attribute ri:mail is a list. In the inbound, I just want to take the first entry in the mail list and target it to emailAddress.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">How can I do this?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The code below simply results in the error:</span><span lang="EN-US">
</span><span lang="EN-US">Attempt to add 2 values to a single-valued item emailAddress<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The input of the inbound attribute is always just one value instead of a list, so I cannot check if the input is a list.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#2B2B2B"><span style="font-size:10.0pt;font-family:"Courier New";color:#E8BF6A;mso-fareast-language:#2000"><attribute><br>
    <ref></span><span style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;mso-fareast-language:#2000">ri:mail</span><span style="font-size:10.0pt;font-family:"Courier New";color:#E8BF6A;mso-fareast-language:#2000"></ref><br>
    <inbound><br>
        <expression><br>
            <script><br>
                <code><span style="background:#364135"><br>
                    </span></span><span style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;background:#364135;mso-fareast-language:#2000">log.info("--input is:"+input)<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#2B2B2B"><span style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;background:#364135;mso-fareast-language:#2000">              
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;background:#364135;mso-fareast-language:#2000">     return input</span><span style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;background:#364135;mso-fareast-language:#2000"><br>
                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#E8BF6A;mso-fareast-language:#2000"></code><br>
            </script><br>
        </expression><br>
        <target><br>
            <path></span><span style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;mso-fareast-language:#2000">emailAddress</span><span style="font-size:10.0pt;font-family:"Courier New";color:#E8BF6A;mso-fareast-language:#2000"></path><br>
        </target><br>
    </inbound><br>
</attribute></span><span style="font-size:10.0pt;font-family:"Courier New";color:#A9B7C6;mso-fareast-language:#2000"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thank you very much for your help in advance!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hsin-Fang<o:p></o:p></span></p>
</div>
</body>
</html>