<?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 update group info using data source in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3260936#M3052</link>
    <description>&lt;P&gt;i have a requirement to update the existing groups and group members, and roles by using the transform map and data source..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all this information was stores in a Excel, i have to upload that file using data source and update the existing data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VSN_0-1747066998693.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/441553i752E99A1A528F437/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VSN_0-1747066998693.png" alt="VSN_0-1747066998693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do&amp;nbsp; i need to create data source and transform maps for different tables like one for Group table, and another for group members table, and another&amp;nbsp; for Roles table.&lt;/P&gt;</description>
    <pubDate>Mon, 12 May 2025 16:25:12 GMT</pubDate>
    <dc:creator>VSN</dc:creator>
    <dc:date>2025-05-12T16:25:12Z</dc:date>
    <item>
      <title>update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3260936#M3052</link>
      <description>&lt;P&gt;i have a requirement to update the existing groups and group members, and roles by using the transform map and data source..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all this information was stores in a Excel, i have to upload that file using data source and update the existing data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VSN_0-1747066998693.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/441553i752E99A1A528F437/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VSN_0-1747066998693.png" alt="VSN_0-1747066998693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do&amp;nbsp; i need to create data source and transform maps for different tables like one for Group table, and another for group members table, and another&amp;nbsp; for Roles table.&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 16:25:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3260936#M3052</guid>
      <dc:creator>VSN</dc:creator>
      <dc:date>2025-05-12T16:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3260963#M3053</link>
      <description>&lt;P&gt;I think you need to achieve this by using two data sources.&lt;/P&gt;&lt;P&gt;1. For Group - we have sys_user_group table where you can update the Name of the Group , Manager &amp;amp; Roles.&lt;/P&gt;&lt;P&gt;(You can create a transform map or simply upload the file from the list view using 'Import excel').&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankyou!&lt;/P&gt;&lt;P&gt;2. For Group members - we have&amp;nbsp;sys_user_grmember table where you can update the Group name &amp;amp; Group Members.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nayanmule_0-1747069437310.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/441561iA70587964CBAB835/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="nayanmule_0-1747069437310.png" alt="nayanmule_0-1747069437310.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 17:05:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3260963#M3053</guid>
      <dc:creator>nayanmule</dc:creator>
      <dc:date>2025-05-12T17:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261001#M3054</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/244717"&gt;@VSN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do this using a &lt;STRONG&gt;single Data Source with two Transform Maps&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 1st Transform Map would target the &lt;STRONG&gt;Group [sys_user_group]&lt;/STRONG&gt; table, and would have field maps for the &lt;STRONG&gt;Name&lt;/STRONG&gt; (coalesce enabled) and &lt;STRONG&gt;Manager&lt;/STRONG&gt; columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To add the roles to the groups you need an "onAfter" Transform Script on the first Transform Map:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	var roleNames = source.getValue('u_roles').split(',');
	var groupId = target.getUniqueValue();

	roleNames.forEach(roleName =&amp;gt; {
		var gr = new GlideRecord('sys_group_has_role');
		gr.addQuery('group', groupId);
		gr.addQuery('role.name', roleName);
		gr.query();
		if (gr.hasNext()) return;
		gr.initialize();
		gr.setValue('group', groupId);
		gr.setDisplayValue('role', roleName);
		gr.insert();
	});
	

})(source, map, log, target);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 2nd Transform Map would target the &lt;STRONG&gt;Group Member [sys_user_grmember]&lt;/STRONG&gt; table, and would map the &lt;STRONG&gt;Name&lt;/STRONG&gt; and &lt;STRONG&gt;User ID&lt;/STRONG&gt; columns (both with coalesce enabled).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 05:48:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261001#M3054</guid>
      <dc:creator>Robert H</dc:creator>
      <dc:date>2025-05-13T05:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261321#M3059</link>
      <description>&lt;P&gt;Can you help me with script?&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 05:27:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261321#M3059</guid>
      <dc:creator>VSN</dc:creator>
      <dc:date>2025-05-13T05:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261333#M3060</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/244717"&gt;@VSN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;approach is already shared by &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/439969"&gt;@Robert H&lt;/a&gt; . Please start from your side as it will be learning for you as well&lt;/P&gt;
&lt;P&gt;you should get details from docs, youtube videos&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 05:36:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261333#M3060</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-05-13T05:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261346#M3061</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/244717"&gt;@VSN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure, I have updated my original reply. And I also reduced the number of required Transform Maps from 3 to 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 05:49:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3261346#M3061</guid>
      <dc:creator>Robert H</dc:creator>
      <dc:date>2025-05-13T05:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3263038#M3083</link>
      <description>&lt;P&gt;it was ignoring the values, not inserting&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 09:11:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3263038#M3083</guid>
      <dc:creator>VSN</dc:creator>
      <dc:date>2025-05-14T09:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3263957#M3096</link>
      <description>&lt;P&gt;That solution not working and we are not creating new role, we are just adding the existing role to group.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 20:01:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3263957#M3096</guid>
      <dc:creator>VSN</dc:creator>
      <dc:date>2025-05-14T20:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3263958#M3097</link>
      <description>&lt;P&gt;&amp;nbsp;Script is not working.because we are adding the existing record of group. Not creating the new roles.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 20:04:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3263958#M3097</guid>
      <dc:creator>VSN</dc:creator>
      <dc:date>2025-05-14T20:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: update group info using data source</title>
      <link>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3264244#M3099</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/244717"&gt;@VSN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is not creating new roles, it adds the roles mentioned in the Roles column of the Excel sheet to the Group.&lt;/P&gt;&lt;P&gt;The solution definitely works, as I have tested it using an Excel sheet that looks exactly like yours before posting it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 05:26:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/update-group-info-using-data-source/m-p/3264244#M3099</guid>
      <dc:creator>Robert H</dc:creator>
      <dc:date>2025-05-15T05:26:03Z</dc:date>
    </item>
  </channel>
</rss>

