<?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>Get PK from a reference table to insert into an entity with FK to that table</title><link>https://community.appian.com/discussions/f/best-practices/28010/get-pk-from-a-reference-table-to-insert-into-an-entity-with-fk-to-that-table</link><description>Hi all, 
 
 This is my uses case. I have a reference table with 2 columns (id(PK) and description) with all the possible statuses: 1 - Ongoing; 2 - Completed, ..... 
 I need to insert an entity case, that it has a FK to that statuses. For instance, idCase</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Get PK from a reference table to insert into an entity with FK to that table</title><link>https://community.appian.com/thread/109017?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 14:15:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:107c2856-a1c0-4dd7-8436-2909bb8e2f54</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;Best option is to use the record relationship.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get PK from a reference table to insert into an entity with FK to that table</title><link>https://community.appian.com/thread/109016?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 13:59:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1c909220-bcc5-43e5-839e-85fa99b7f29b</guid><dc:creator>Komal Jain</dc:creator><description>&lt;p&gt;Hi Rafael,&lt;/p&gt;
&lt;p&gt;I would suggest to set status Id into the constant and map it to case cdt based on your workflow status.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;cons!STATUS_ID&lt;/p&gt;
&lt;p&gt;Description&lt;/p&gt;
&lt;p&gt;1.Ongoing&lt;/p&gt;
&lt;p&gt;2.Completed&lt;/p&gt;
&lt;p&gt;3.Rejected&lt;/p&gt;
&lt;p&gt;values&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;2&lt;/p&gt;
&lt;p&gt;3&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Eg if the flow is in progress&lt;/p&gt;
&lt;p&gt;{idCase:1,&lt;/p&gt;
&lt;p&gt;idStatus:&lt;span&gt;cons!STATUS_ID[1&lt;/span&gt;&lt;span&gt;]}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For Records&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;you can create view for Case&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;put join for status table where statusId=idstatus&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get PK from a reference table to insert into an entity with FK to that table</title><link>https://community.appian.com/thread/108979?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 01:15:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b6941c7f-46d9-474c-bb71-b9cae079769f</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;1. Save the status ID in case table&lt;/p&gt;
&lt;p&gt;2. If you are using latest version of Appian&amp;nbsp; Create a Case Record and add status reference as a related record&amp;nbsp; and&amp;nbsp;add status coulmn to case record&lt;/p&gt;
&lt;p&gt;3. if you are using old version of Appian, create a View by joining case and status table, then create a record with that view&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Refer Appian documentation here for more details&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/23.1/record-type-relationships.html"&gt;https://docs.appian.com/suite/help/23.1/record-type-relationships.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>