<html><body>Hi All,<div><br></div><div>last time I tryed to import soem users from CSV file. Gustav helped me to solve some things.</div><div><br></div><div>Now i am trying to prevent existence same login / email address. There is a lot of examples</div><div><br></div><div>But it do not work for me. What I am doing wrong? </div><div><br></div><div>Template used for sync of users:</div><div><br></div><div><div><objectTemplate xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"</div><div> xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"</div><div> xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"</div><div> xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"</div><div> xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"</div><div> xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"</div><div> xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"</div><div> oid="c0c010c0-d34d-b33f-f00d-777333333333"</div><div> version="18"></div><div> <name>User Template</name></div><div> <metadata></div><div> <createTimestamp>2017-11-07T02:04:12.135+01:00</createTimestamp></div><div> <creatorRef oid="00000000-0000-0000-0000-000000000002"</div><div> relation="org:default"</div><div> type="c:UserType"><!-- administrator --></creatorRef></div><div> <createChannel>http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport</createChannel></div><div> </metadata></div><div> <iteration></div><div> <maxIterations>999</maxIterations></div><div> <tokenExpression></div><div> <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div><div> xsi:type="c:ScriptExpressionEvaluatorType"></div><div> <code></div><div> if (iteration == 0) {</div><div> return "";</div><div> } else {</div><div> return sprintf("%03d", iteration);</div><div> }</div><div> </code></div><div> </script></div><div> </tokenExpression></div><div> </iteration></div><div> <mapping></div><div> <description></div><div> Property mapping.</div><div> Defines how properties of user object are set up.</div><div> This specific definition sets a full name as a concatenation</div><div> of givenName and familyName.</div><div> </description></div><div> <strength>weak</strength></div><div> <source></div><div> <c:path>$user/givenName</c:path></div><div> </source></div><div> <source></div><div> <c:path>$user/familyName</c:path></div><div> </source></div><div> <expression></div><div> <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div><div> xsi:type="c:ScriptExpressionEvaluatorType"></div><div> <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language></div><div> <code></div><div> givenName + ' ' + familyName</div><div> </code></div><div> </script></div><div> </expression></div><div> <target></div><div> <c:path>$user/fullName</c:path></div><div> </target></div><div> </mapping></div><div> <mapping></div><div> <description></div><div> Property mapping.</div><div> Defines how properties of user object are set up.</div><div> This specific definition sets a full name as a concatenation</div><div> of givenName and familyName.</div><div> </description></div><div> <strength>weak</strength></div><div> <source></div><div> <c:path>$user/givenName</c:path></div><div> </source></div><div> <source></div><div> <c:path>$user/familyName</c:path></div><div> </source></div><div> <expression></div><div> <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div><div> xsi:type="c:ScriptExpressionEvaluatorType"></div><div> <language>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</language></div><div> <code></div><div> givenName + '.' + familyName + '@hell.cz'</div><div> </code></div><div> </script></div><div> </expression></div><div> <target></div><div> <c:path>$user/emailAddress</c:path></div><div> </target></div><div> </mapping></div><div></objectTemplate></div></div><div><br></div><div>It looks like iterationToken do not have any value (is NULL) but values in CSV files are created to make a conflict for user 07 and 08.</div><div><br></div><div><div>guid,username,firstname,lastname,disabled,password</div><div>01,user01,Firstname,Lastname,false,secret</div><div>02,user02,Test,Lastname,false,secret</div><div>03,user03,jan,kaspar,false,secret</div><div>04,Test,FirstTest,LastTest,false,secret</div><div>05,test05,F5,E5,false,secret</div><div>06,test06,F5,F5,false,secret</div><div>07,test07,F7,F7,false,secret</div><div>08,test08,F7,F7,false,secret</div></div><div><br></div><div>What I am missing? </div><div><br></div><div>Jan</div></body></html>