<?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 Re: How to run &amp;quot;Populate primary resource attributes&amp;quot; from background script in SPM forum</title>
    <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468662#M50021</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;check if any Restricted caller access is blocking&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jan 2026 10:59:35 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2026-01-16T10:59:35Z</dc:date>
    <item>
      <title>How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466194#M49978</link>
      <description>&lt;P&gt;I have to create a Action in flow designer, where I will be passing user sys_id. I want to trigger "Populate primary resource attributes".&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 12:46:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466194#M49978</guid>
      <dc:creator>DhathriC</dc:creator>
      <dc:date>2026-01-13T12:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466254#M49980</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can check this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-blog/servicenow-flow-designer-custom-action-custom-action-demo-in/ba-p/2333141" target="_blank"&gt;https://www.servicenow.com/community/developer-blog/servicenow-flow-designer-custom-action-custom-action-demo-in/ba-p/2333141&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=HQZCUQQd0ro" target="_blank"&gt;https://www.youtube.com/watch?v=HQZCUQQd0ro&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 13:23:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466254#M49980</guid>
      <dc:creator>Tejas Adhalrao</dc:creator>
      <dc:date>2026-01-13T13:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466260#M49982</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/948368"&gt;@Tejas Adhalrao&lt;/a&gt;&amp;nbsp;, I'm aware of how to create actions. I want to understand what is getting triggered or updated specifically for "&lt;SPAN&gt;&amp;nbsp;"Populate primary resource attributes" UI action.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 13:26:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466260#M49982</guid>
      <dc:creator>DhathriC</dc:creator>
      <dc:date>2026-01-13T13:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466266#M49983</link>
      <description>&lt;P&gt;Hi Dhathri,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you are referring to the standard Resource Management function to sync a user's roles and group memberships to the Resource tables (so they appear correctly in the Resource Finder), the Script Include you are looking for is likely &lt;STRONG&gt;ResourceAssociationManager&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is how you can use it in your &lt;STRONG&gt;Flow Designer Action&lt;/STRONG&gt; (Script Step):&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;(&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;function&lt;/SPAN&gt; &lt;SPAN class=""&gt;execute&lt;/SPAN&gt;(&lt;SPAN class=""&gt;inputs, outputs&lt;/SPAN&gt;) &lt;/SPAN&gt;{
    
    &lt;SPAN class=""&gt;var&lt;/SPAN&gt; userID = inputs.user_sys_id; &lt;SPAN class=""&gt;// Map this from your Action Input&lt;/SPAN&gt;
    
    &lt;SPAN class=""&gt;if&lt;/SPAN&gt; (userID) {
        &lt;SPAN class=""&gt;// This standard library updates the resource associations (groups, roles) for the user&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;new&lt;/SPAN&gt; ResourceAssociationManager().updateUserAssociations(userID);
    }

})(inputs, outputs);&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;How to verify if this is the correct script:&lt;/STRONG&gt; If "Populate primary resource attributes" is a specific &lt;STRONG&gt;UI Action (Button)&lt;/STRONG&gt; you see on a form:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Right-click the button header or go to &lt;STRONG&gt;System Definition &amp;gt; UI Actions&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Search for the name "Populate primary resource attributes".&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Open the record and look at the &lt;STRONG&gt;Script&lt;/STRONG&gt; field. It will show you the exact API call used.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;However, typically for Resource Management syncing, ResourceAssociationManager is the key class.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;If this response helps you solve the issue, please mark it as Accepted Solution.&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRONG&gt;This helps the community grow and assists others in finding valid answers faster.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Brandão.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 13:39:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466266#M49983</guid>
      <dc:creator>Itallo Brandão</dc:creator>
      <dc:date>2026-01-13T13:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466275#M49984</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have below script to run.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; execute(inputs, outputs) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// ... code ...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; grUser = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideRecord&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'sn_employee_profile'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;grUser.addQuery(&lt;/SPAN&gt;&lt;SPAN&gt;'user'&lt;/SPAN&gt;&lt;SPAN&gt;,inputs.user);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;grUser.query();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;(grUser.next()){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; plngAttrsGr = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; sn_plng_att_core.&lt;/SPAN&gt;&lt;SPAN&gt;PlanningAttributes&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; activeAttrs = plngAttrsGr.getAllResourceAttributes();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; attributesConfig = {}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;(activeAttrs.next()){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; fieldName = activeAttrs.getValue(grUser.sys_id);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;([&lt;/SPAN&gt;&lt;SPAN&gt;'primary_resource_group'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'primary_resource_role'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'primary_resource_skill'&lt;/SPAN&gt;&lt;SPAN&gt;].includes(fieldName)){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; attributesConfig[fieldName] = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; userRefField : activeAttrs.getValue(&lt;/SPAN&gt;&lt;SPAN&gt;'resource_reference_field'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;ResourceProfileSyncService&lt;/SPAN&gt;&lt;SPAN&gt;(attributesConfig).populatePrimaryAttrsForResource(&lt;/SPAN&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.getParameter(&lt;/SPAN&gt;&lt;SPAN&gt;'resource_profile_sys_id'&lt;/SPAN&gt;&lt;SPAN&gt;)); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;})(inputs, outputs);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Jan 2026 13:46:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466275#M49984</guid>
      <dc:creator>DhathriC</dc:creator>
      <dc:date>2026-01-13T13:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466323#M49986</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there is an OOTB scheduled job for this "&lt;STRONG style="box-sizing: border-box; font-weight: bold; color: #1d1d1d; font-family: ServiceNowSansRegular; font-size: 14px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;MARK style="box-sizing: border-box; background: #fcf8e3; color: #000000; padding: 0.2em;"&gt;Populate primary attributes for all resources&lt;/MARK&gt;&lt;/STRONG&gt;"&lt;/P&gt;
&lt;P&gt;Check code of that and use in your flow action&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;Invoke the scheduled job using script in custom flow action&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; var gr = new GlideRecord("sysauto_script");
 gr.addQuery("name", "Populate primary attributes for all resources");
 gr.query();
 if (gr.next()) {
     gs.executeNow(gr);
 }&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnkurBawiskar_0-1768316356279.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/495383i01376454C8298152/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnkurBawiskar_0-1768316356279.png" alt="AnkurBawiskar_0-1768316356279.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 15:00:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466323#M49986</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-01-13T15:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466354#M49987</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp; This scheduled job is for Bulk, Can we execute only for 1 user, by passing sys_id of the user&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 15:24:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466354#M49987</guid>
      <dc:creator>DhathriC</dc:creator>
      <dc:date>2026-01-13T15:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466614#M49992</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then please explore within that scheduled job which function is called and then use that script in your flow action and modify such that it takes 1 user&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2026 02:39:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466614#M49992</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-01-14T02:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466637#M49993</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there are different script includes involved&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ResourceProfileSyncServiceSNC&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnkurBawiskar_0-1768359884252.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/495460i286073237B444A4A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnkurBawiskar_0-1768359884252.png" alt="AnkurBawiskar_0-1768359884252.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PlanningAttributesSNC&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnkurBawiskar_2-1768359934521.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/495462iC70CBECBF955E3C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnkurBawiskar_2-1768359934521.png" alt="AnkurBawiskar_2-1768359934521.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2026 03:05:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3466637#M49993</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-01-14T03:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3467439#M50009</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you are doing good.&lt;/P&gt;
&lt;P&gt;Did my reply answer your question?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 02:53:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3467439#M50009</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-01-15T02:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468638#M50019</link>
      <description>&lt;P&gt;I'm trying below script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;// If you only have sys_user.sys_id, resolve the profile first:&lt;/DIV&gt;&lt;DIV&gt;var userSysId = '001701001b881d94f7590f6cdc4bcb5a';&lt;/DIV&gt;&lt;DIV&gt;var prof = new GlideRecord('sn_employee_profile');&lt;/DIV&gt;&lt;DIV&gt;prof.addQuery('user', userSysId);&lt;/DIV&gt;&lt;DIV&gt;prof.setLimit(1);&lt;/DIV&gt;&lt;DIV&gt;prof.query();&lt;/DIV&gt;&lt;DIV&gt;if (prof.next()) {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; gs.info('Done for profile ' + prof.getUniqueValue());&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; svc.populatePrimaryAttrsForResource(prof.getUniqueValue());&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; gs.info('Done for profile ' + prof.getUniqueValue());&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;var cfg = {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; "primary_resource_group": {"userRefField":"user"},&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; "primary_resource_skill": {"userRefField":"user"},&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; "primary_resource_role":&amp;nbsp; {"userRefField":"user"}&lt;/DIV&gt;&lt;DIV&gt;};&lt;/DIV&gt;&lt;DIV&gt;var svc = new global.ResourceProfileSyncServiceSNC(cfg);&lt;/DIV&gt;&lt;DIV&gt;} else {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; gs.warn('No employee profile found for user ' + userSysId);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm getting below error:&lt;/DIV&gt;&lt;DIV&gt;I added Restricted caller access, Ran the script in Employee profile scope. Still getting error like below.&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;Source descriptor is empty while recording access for table sn_employee_profile: no thrown error&lt;BR /&gt;Security restricted: Read operation on table 'sn_employee_profile' from scope 'Global' was denied because the source could not be found. Please contact the application admin.&lt;BR /&gt;Security restricted: Read operation on table 'sn_employee_profile' from scope 'Global' was denied. The application 'Employee Profile' must declare a Restricted Caller Access privilege. Please contact the application admin to update their access requests.&lt;BR /&gt;*** Script: No employee profile found for user 001701001b881d94f7590f6cdc4bcb5a&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Jan 2026 10:39:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468638#M50019</guid>
      <dc:creator>DhathriC</dc:creator>
      <dc:date>2026-01-16T10:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468662#M50021</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1031645"&gt;@DhathriC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;check if any Restricted caller access is blocking&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2026 10:59:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468662#M50021</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-01-16T10:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to run "Populate primary resource attributes" from background script</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468690#M50023</link>
      <description>&lt;P&gt;I have given access in &lt;U&gt;"Restricted caller access priveliges"&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2026 11:46:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-run-quot-populate-primary-resource-attributes-quot-from/m-p/3468690#M50023</guid>
      <dc:creator>DhathriC</dc:creator>
      <dc:date>2026-01-16T11:46:06Z</dc:date>
    </item>
  </channel>
</rss>

