<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.smt-x.com/index.php?action=history&amp;feed=atom&amp;title=Import_persons_into_custom_actor</id>
	<title>Import persons into custom actor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.smt-x.com/index.php?action=history&amp;feed=atom&amp;title=Import_persons_into_custom_actor"/>
	<link rel="alternate" type="text/html" href="https://wiki.smt-x.com/index.php?title=Import_persons_into_custom_actor&amp;action=history"/>
	<updated>2026-04-04T00:48:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://wiki.smt-x.com/index.php?title=Import_persons_into_custom_actor&amp;diff=914&amp;oldid=prev</id>
		<title>Smtxwiki: Created page with &quot;The script below was written to import people from a CSV file as actor in a service, for which only the id was available. The actor field was a custom multi person field.   var file=#1#; //The CSV file comes here. Structure: header on top, per line: serviceid, servicename, actoremail  var fileLines=file.split(&#039;\r\n&#039;);  var log=[];  var allServices = JSON.parse(ServiceCatalogInterface.getAllServicesSummary());  for (var i=1; i&lt; fileLines.length; i++) {    var newActor=fil...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.smt-x.com/index.php?title=Import_persons_into_custom_actor&amp;diff=914&amp;oldid=prev"/>
		<updated>2024-08-06T11:45:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The script below was written to import people from a CSV file as actor in a service, for which only the id was available. The actor field was a custom multi person field.   var file=#1#; //The CSV file comes here. Structure: header on top, per line: serviceid, servicename, actoremail  var fileLines=file.split(&amp;#039;\r\n&amp;#039;);  var log=[];  var allServices = JSON.parse(ServiceCatalogInterface.getAllServicesSummary());  for (var i=1; i&amp;lt; fileLines.length; i++) {    var newActor=fil...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The script below was written to import people from a CSV file as actor in a service, for which only the id was available. The actor field was a custom multi person field.&lt;br /&gt;
&lt;br /&gt;
 var file=#1#; //The CSV file comes here. Structure: header on top, per line: serviceid, servicename, actoremail&lt;br /&gt;
 var fileLines=file.split(&amp;#039;\r\n&amp;#039;);&lt;br /&gt;
 var log=[];&lt;br /&gt;
 var allServices = JSON.parse(ServiceCatalogInterface.getAllServicesSummary());&lt;br /&gt;
 for (var i=1; i&amp;lt; fileLines.length; i++) {&lt;br /&gt;
   var newActor=fileLines[i].split(&amp;#039;;&amp;#039;);&lt;br /&gt;
   if (newActor.length === 3 &amp;amp;&amp;amp; newActor[2]) {&lt;br /&gt;
      var service = allServices.filter(function(s) { return s.id === +newActor[0]});&lt;br /&gt;
      if (service &amp;amp;&amp;amp; service.length === 1 &amp;amp;&amp;amp; service[0].template &amp;amp;&amp;amp; service[0].template.name === &amp;#039;Regelgeving - HBBZ&amp;#039;) {&lt;br /&gt;
         CommonInterface.callWebservice(&amp;#039;Services: add person to service person list&amp;#039;, { &lt;br /&gt;
            &amp;#039;ServiceGuid&amp;#039;: service[0].guid, &lt;br /&gt;
            &amp;#039;TypeName&amp;#039;: &amp;#039;CustomActor&amp;#039;, &lt;br /&gt;
            &amp;#039;CustomActorInternalName&amp;#039;: &amp;#039;Redactieteam&amp;#039;,&lt;br /&gt;
            &amp;#039;ActorPerson&amp;#039;: &amp;#039;1&amp;#039;,&lt;br /&gt;
            &amp;#039;Person&amp;#039;: newActor[2],&lt;br /&gt;
            &amp;#039;ProviderName&amp;#039;: &amp;#039;xxx&amp;#039;,&lt;br /&gt;
            &amp;#039;SecurityCheck&amp;#039;: &amp;#039;xxxx&amp;#039;,&lt;br /&gt;
         });&lt;br /&gt;
      log.push(&amp;#039;Person &amp;#039; + newActor[2] + &amp;#039; added to service id &amp;#039; + service[0].id + &amp;#039; (&amp;#039; + service[0].guid + &amp;#039;) &amp;#039; + service[0].name);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 return log.join(&amp;#039;\n&amp;#039;);&lt;/div&gt;</summary>
		<author><name>Smtxwiki</name></author>
	</entry>
</feed>