<?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>Many to Many relationship implementation</title><link>https://community.appian.com/discussions/f/data/11128/many-to-many-relationship-implementation</link><description>Hi, 
 I have a requirement to implement Many to Many relationship in database. How best is to implement this? I have gone through the below article and it was mentioned that just to attain one to many relationship in database and then Appian will handle</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Many to Many relationship implementation</title><link>https://community.appian.com/thread/80722?ContentTypeID=1</link><pubDate>Mon, 05 Apr 2021 02:32:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:439b6a34-a0c7-4cd3-b9a8-28706a844e07</guid><dc:creator>SreeHarshaK</dc:creator><description>&lt;p&gt;how to retrieve the values&amp;nbsp; in the&amp;nbsp; record to display ,&amp;nbsp; using&amp;nbsp; records?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Many to Many relationship implementation</title><link>https://community.appian.com/thread/48916?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2017 14:56:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff57d697-90c0-4183-ad3d-daf8fbb1631b</guid><dc:creator>davids0001</dc:creator><description>This is basically the only way to do it if you expect data to change.  Otherwise, you won&amp;#39;t be able to delete one employee without deleting all of his projects, and then deleting all of the employees associated with those projects, and then all of the projects associated with those employees, and all employees associated with those, on and on until all or nearly all of your database is gone.&lt;br /&gt;
&lt;br /&gt;
Or you could delete one employee, all of his references in the mapping table, and you&amp;#39;re done.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Many to Many relationship implementation</title><link>https://community.appian.com/thread/48851?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2017 10:56:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45940320-cdc8-4b34-8d16-db34895ab18d</guid><dc:creator>Alok Patro</dc:creator><description>Please follow the documentation for building up Many-to-Many Relationships.&lt;br /&gt;
Some points to remember is :&lt;br /&gt;
1. Proper mapping of relationships is being done. (Primary and Foreign Key).&lt;br /&gt;
2. Have well defined primary key column instead of allowing allowing appian to create some random primary key column.&lt;br /&gt;
3. Also considerations need to taken in case of update and deletion of data. (CASCADE or RESTRICT).&lt;br /&gt;
4. Incase you are writing to all the tables, i will suggest using of a nested CDT to write data instead of many write to datastore entity nodes. So, it would make less database calls and will be more efficient.&lt;br /&gt;
&lt;br /&gt;
I hope these points help you for your implementation.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Many to Many relationship implementation</title><link>https://community.appian.com/thread/48824?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2017 14:59:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d40eec2-c5a3-487f-9fd7-ce2831948c9c</guid><dc:creator>harrisont606</dc:creator><description>For these types of scenarios I usually find it safer to just make 3 separate tables and handle their relationship entirely in the DB. Let&amp;#39;s look at the existing example of employees and projects. You would make one table for employees, one for projects, and an additional mapping table. The mapping table will have at least 3 columns, a primary key, a foreign key to the employee table, and a foreign key to the projects table. These should be enforced through foreign key constraints. You can then make a CDT for each table. &lt;br /&gt;
&lt;br /&gt;
I also recommend making views that join through the mapping table. For example, let&amp;#39;s say you wanted to get all the projects for a given employee without a view. You could query the mapping table by employee ID, which would yield a list of project IDs. Then you could query the project table by these IDs. This would require two queries though. A better method would be to join these tables together through the mapping table, and query this view by employee. You will also need to make a CDT for this view.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Many to Many relationship implementation</title><link>https://community.appian.com/thread/48808?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2017 08:49:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5e707e0e-e281-446b-af03-dd85b8a65b63</guid><dc:creator>vijayd</dc:creator><description>It is clearly explained in the documentation link you shared. Not sure what exactly you are looking for ?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>