<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Set Default Value to field from Reference in SPM forum</title>
    <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033196#M29401</link>
    <description>&lt;P&gt;Is there a way to set the default value to a dot walked field of a reference field on the same table? See example below on the Change Order table. Would like to set the "Requested for" default value to be the business contact which comes from the Project itself (referenced in Project Number). Is there any way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/104767i873BF49F12A36EE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2015 17:39:24 GMT</pubDate>
    <dc:creator>jenn123</dc:creator>
    <dc:date>2015-11-11T17:39:24Z</dc:date>
    <item>
      <title>Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033196#M29401</link>
      <description>&lt;P&gt;Is there a way to set the default value to a dot walked field of a reference field on the same table? See example below on the Change Order table. Would like to set the "Requested for" default value to be the business contact which comes from the Project itself (referenced in Project Number). Is there any way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/104767i873BF49F12A36EE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 17:39:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033196#M29401</guid>
      <dc:creator>jenn123</dc:creator>
      <dc:date>2015-11-11T17:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033197#M29402</link>
      <description>&lt;P&gt;On the Requested for you can set the default value to be the project business contact. You can right click on the requested for field and choose Configure &amp;gt; Dictionary. In the default value field you would put the following (I guessed at the field names so you would want to validate those):&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;javascript: current.u_project_number.u_business_contact;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 17:45:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033197#M29402</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2015-11-11T17:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033198#M29403</link>
      <description>&lt;P&gt;Hi Brad,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks for the information. This doesn't seem to be working for me. I'm actually using a dictionary override for the default value, since I don't want to modify the default value on the task table itself. But I would think that should work the same way? Anyway, I tried what you suggested and the field is still blank. I also tried using a function (see below) to see what it's returning. According to the message that comes up, current.u_project.u_business_contact is null.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;javascript:_getID();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function _getID() {&lt;BR /&gt; &amp;nbsp; var name = current.u_project.u_business_contact;&lt;BR /&gt; &amp;nbsp; gs.addInfoMessage('name is ' + name);&lt;BR /&gt; &amp;nbsp; return name;&lt;BR /&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Anything else I can try?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 17:58:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033198#M29403</guid>
      <dc:creator>jenn123</dc:creator>
      <dc:date>2015-11-11T17:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033199#M29404</link>
      <description>&lt;P&gt;Can you try with an onLoad Client script to set the value of the requested for as per the Project number?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Suraj Chauhan&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 18:12:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033199#M29404</guid>
      <dc:creator>User179407</dc:creator>
      <dc:date>2015-11-11T18:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033200#M29405</link>
      <description>&lt;P&gt;Hi Jennifer,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;What I have seen is when you point directly to the reference field - &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;u_business_contact, it returns a sys_id. &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;I *think*, and sorry i dont have time to test right now, that if you add " _name" to the reference, it should work..&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;So you are actually pointing to the field name that contains the name, not the reference object. &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;I hope that helps.. Let me know if it works!&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;Emily&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 18:17:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033200#M29405</guid>
      <dc:creator>ITSMgal</dc:creator>
      <dc:date>2015-11-11T18:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033201#M29406</link>
      <description>&lt;P&gt;Hi Jennifer,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Have you validated that u_project and u_business_contact are the correct field names? Also, is u_business_contact a reference field to the user table? I would not do this through a client script.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 18:23:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033201#M29406</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2015-11-11T18:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033202#M29407</link>
      <description>&lt;P&gt;Yes, those are the correct field names. And yes, u_business_contact is a reference field to the user table, so is the Requested For field. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 18:45:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033202#M29407</guid>
      <dc:creator>jenn123</dc:creator>
      <dc:date>2015-11-11T18:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033203#M29408</link>
      <description>&lt;P&gt;Hi Emily,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks for the suggestion. Unfortunately it didn't seem to work for me&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 18:46:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033203#M29408</guid>
      <dc:creator>jenn123</dc:creator>
      <dc:date>2015-11-11T18:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033204#M29409</link>
      <description>&lt;P&gt;How is the u_project field getting populated on the record? If that field is not yet populated when the record is created then we may not be able to use a default value.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 18:57:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033204#M29409</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2015-11-11T18:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033205#M29410</link>
      <description>&lt;P&gt;It's being populated automatically to be whatever project is open when you click "New" from the Change Orders related list (which is on the Project form) - not sure if that answers your question? Thanks again for your help!&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 20:56:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033205#M29410</guid>
      <dc:creator>jenn123</dc:creator>
      <dc:date>2015-11-11T20:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033206#M29411</link>
      <description>&lt;P&gt;Hmm...If it's not working this way I would try it in a before insert business rule instead.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.u_requested_for = current.u_project.u_business_contact;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2015 21:20:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033206#M29411</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2015-11-11T21:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Default Value to field from Reference</title>
      <link>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033207#M29412</link>
      <description>&lt;P&gt;That worked - thanks very much!&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:47:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/set-default-value-to-field-from-reference/m-p/1033207#M29412</guid>
      <dc:creator>jenn123</dc:creator>
      <dc:date>2015-11-13T14:47:36Z</dc:date>
    </item>
  </channel>
</rss>

