<?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>saving data to database</title><link>https://community.appian.com/discussions/f/new-to-appian/40197/saving-data-to-database</link><description>In UI I have option to add data using addRowLink. Once I select one name consider h1, then I click on addRow then there I can write any alphanumeric code and I am storing that in backend. but if I am selecting multiple names(2) then if I click on addRowLink</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153598?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 14:45:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f050450-c04c-4f8f-8ff0-2756807f168f</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;1)&amp;nbsp;&lt;span&gt;how to achieve it only one rowlink should be added: Remove the foreach()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2)&amp;nbsp;in backend the same value should be saved for multiple values: I do not know your data model. But some king of a one-to-many relationship might be an idea.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3)&amp;nbsp;submit button is not available in this interface: Add a submit button. I do not know what you are doing or plan to achieve. The standard Appian way is the add an interface to a process start form, acquire the data in the form, submit it, and store the data using a write records node.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153597?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 14:39:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d513e7f-e0bd-40a0-8bae-18329fd1e759</guid><dc:creator>harshithal2027</dc:creator><description>&lt;p&gt;then how to achieve it only one rowlink should be added and in backend the same value should be saved for multiple values and submit button is not available in this interface&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153595?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 14:36:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:916f6b76-4665-4ba1-a672-847363c36ef7</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;OK, but in line 7 you add one item for each selected insurer. If you only want to add a single item, foreach() will not make it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153593?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 14:29:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:720c994a-c3ec-4716-8603-762e9532ae3c</guid><dc:creator>harshithal2027</dc:creator><description>&lt;p&gt;no if I select two values and if I click on addrowlink only one row should be available but I am getting 2 rows as shown in image. I want only one row even If I select multiple values in dropdown but in database the code should be updated for all selectedvalues&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1771252035079v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153591?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 14:18:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2435a629-0150-416c-87c2-40ed53056718</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;So you say that you want to add only one item, even if you select multiple. Correct?&lt;/p&gt;
&lt;p&gt;If yes, what is the foreach doing?&lt;/p&gt;
&lt;p&gt;I really have a hard time following your explanation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153585?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 11:52:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:decba998-423f-4439-bd8f-1d00a9dc2c5d</guid><dc:creator>harshithal2027</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;saveInto: {
                   a!localVariables(
                     /* Build one new row per selected partyId (no duplicate prevention) */
                     local!newRows: if(
                       a!isNullOrEmpty(local!selectedInsuredId),
                       {},
                       a!forEach(
                         items: local!selectedInsuredId,
                         expression: a!localVariables(
                           /* Find the index of this party to resolve its applicationId */
                           local!idx: index(fv!item,
                             wherecontains(fv!item, local!insuredParty[&amp;#39;recordType!{f953bbb6-0363-40ce-afe7-4fd0315e1fc0}UWG Party.fields.{19291ea5-16a7-4ddb-9fc9-dbd77b0f9b3e}id&amp;#39;]),
                             
                             null()
                           ),
                           /* Construct a new UWG MIB Reporting Code row */
                           &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code&amp;#39;(
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{42e0ad63-0ba5-42bf-bf62-feff961f8d11}applicationId&amp;#39;:
                             index(local!insuredParty[&amp;#39;recordType!{f953bbb6-0363-40ce-afe7-4fd0315e1fc0}UWG Party.fields.{0b7cc71a-9085-4b8d-8173-d3fb2dfcaeed}appianApplicationID&amp;#39;], local!idx, null()),
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{b7e4ad0f-8daa-4d4e-bdff-38c77b595b2a}mrcIsMibReportingCodeValidated&amp;#39;: false,
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{36931678-bcb8-43ba-abd3-9f09fa9ec90e}partyId&amp;#39;: fv!item,
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{5a73b0fe-cee4-4d8f-b9d5-cc3a7a574644}createdOn&amp;#39;: now(),
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{4ea74402-050f-4d34-b459-3ae196ba1c73}createdBy&amp;#39;: loggedInUser(),
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{da86ac28-b1d2-41c3-ab2b-11af8f8b9c24}updatedOn&amp;#39;: now(),
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{a1ee9757-ddda-4f4c-a659-68c1d6ebbfe8}updatedBy&amp;#39;: loggedInUser(),
                             &amp;#39;recordType!{a705bdd4-5853-4575-bf26-39f58fbcb25a}UWG MIB Reporting Code.fields.{ed97db33-4b1a-458d-bd65-f33878fa9879}isActive&amp;#39;: true
                           )
                         )
                       )
                     ),

                     /* Perform ONE append to avoid &amp;quot;last save wins&amp;quot; */
                     if(
                       a!isNullOrEmpty(local!newRows),
                       {},
                       {
                         a!save(ri!mibReportingCodes, append(ri!mibReportingCodes, local!newRows)),
                         a!save(local!mibCodesValidated, null()),
                         a!save(local!noMibCodesAdded, null())
                       }
                     )
                   )
                   
                  }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saving data to database</title><link>https://community.appian.com/thread/153581?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 11:47:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5d7f1c8a-ca46-4163-8703-7178eabcd312</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1771242457558v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>