<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>inserting data in my DB one to many relation</title><link>https://community.appian.com/discussions/f/data/18280/inserting-data-in-my-db-one-to-many-relation</link><description>Hello All, 
 I have a problem with inserting Data into my Database, my CDT named &amp;quot;class&amp;quot; has {emplyeeID, courseID, status} I want to write the following: {EmployeeID: 1, CourseID:1, status: &amp;quot;Not started},{EmployeeID:1, courseID:2, status:&amp;quot;In progress</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: inserting data in my DB one to many relation</title><link>https://community.appian.com/thread/72184?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 22:49:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:896d6951-0311-400e-b876-24802f955da3</guid><dc:creator>Evan Rust</dc:creator><description>&lt;p&gt;Since you are writing to an array, you have to pass an array.&amp;nbsp; If you pass a single (scalar) value, then only the first index in the array will be written to.&lt;/p&gt;
&lt;p&gt;In this use case, I usually pass: repeat(length(pv!class),pv!employee.employeeID).&amp;nbsp; In other words, for every row in class, write the employeeID.&lt;/p&gt;
&lt;p&gt;One caveat is that you have to include a null check, since length() will not like if you pass a null.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: inserting data in my DB one to many relation</title><link>https://community.appian.com/thread/71947?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 03:21:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:901adc46-189c-4950-af2b-c2b48e959816</guid><dc:creator>ankitab0001</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/marouaneb"&gt;marouaneb&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You need to use looping function when you are mapping it like this. Also, make sure pv!employee is also multiple&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>