<?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>Upload several files and save to database</title><link>https://community.appian.com/discussions/f/general/14656/upload-several-files-and-save-to-database</link><description>Hello, I need help!! I have this field to upload documents to a database a!fileUploadField( label: &amp;quot;Document&amp;quot;, labelPosition: &amp;quot;ADJACENT&amp;quot;, /*maxSelections: 1,*/ value: ri!newDo.docum, saveInto: { ri!newSoli.documentation, ri!newDo.docum, a!save(ri!newDo</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/79795?ContentTypeID=1</link><pubDate>Tue, 23 Feb 2021 17:25:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ea8f207b-4b39-4e92-b075-a2c39895648d</guid><dc:creator>Deepak Shinde</dc:creator><description>&lt;p&gt;How to store a structure multiple file uploaded into DB column and retrieve from DB ? for downloading&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/65704?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 09:29:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:68fad5b1-2e19-4f7f-ab0d-f601c364b06e</guid><dc:creator>mpatram</dc:creator><description>&lt;p&gt;declare a local variable and use it in your fileUploadField control.&lt;/p&gt;
&lt;p&gt;code for&amp;nbsp; file upload field:&lt;/p&gt;
&lt;p&gt;a!fileUploadField(&lt;br /&gt;&amp;nbsp; &amp;nbsp;label: &amp;quot;&lt;span lang="en"&gt;Document&lt;/span&gt;&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp;labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp;target:&lt;span lang="en"&gt;cons!C_FLD_document&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp;value: &lt;span&gt;local!loadedFiles&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp;saveInto: &lt;span&gt;local!loadedFiles&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp;validations: {}&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;put the below code in your button saveInto:&lt;/p&gt;
&lt;p&gt;saveInto: {&lt;br /&gt;a!forEach(&lt;br /&gt;items: local!loadedFiles,&lt;br /&gt;expression: {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a!save(ri!loadedFiles[fv!index].fileAttached, fv!item)&lt;br /&gt;}}&lt;/p&gt;
&lt;p&gt;-----------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ri!loadedFiles: is your CDT where you are loading the files.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;fileAttached: a column in your CDT&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/65700?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 07:43:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76097a0b-9786-4ac6-920a-2ac813274cab</guid><dc:creator>Alastr</dc:creator><description>&lt;pre class="tw-data-text tw-ta tw-text-medium" dir="ltr"&gt;&lt;span lang="en"&gt;Thanks! &lt;br /&gt;&lt;br /&gt;But I do not know what to put to replace&lt;br /&gt;&lt;span&gt;local! loadedFiles&lt;/span&gt;&lt;br /&gt;&lt;span&gt;fv! index&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-ta tw-text-medium" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;it would be like this?&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-ta tw-text-medium" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;&amp;nbsp;a!fileUploadField(&lt;br /&gt; label: &amp;quot;Document&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ADJACENT&amp;quot;,&lt;br /&gt; /*maxSelections: 1,*/&lt;br /&gt; value: ri!newDo.docum,&lt;br /&gt; saveInto:&lt;br /&gt; {&lt;br /&gt; a!forEach(&lt;br /&gt; items: ri!newDo.documentation,&lt;br /&gt; expression: {&lt;br /&gt; a!save(ri!newDo.documentation[fv!index].fileAttached, fv!item)&lt;br /&gt; }&lt;br /&gt; ),&lt;br /&gt; ri!newSoli.documentation,&lt;br /&gt; ri!newDo.docum,&lt;br /&gt; a!save(ri!newDo.day,now())&lt;br /&gt; },&lt;br /&gt; target: cons!C_FLD_document,&lt;br /&gt; validations: {}&lt;br /&gt; )&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/65699?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 07:16:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98bcc315-77b0-4d5c-9bf5-09b5473ec301</guid><dc:creator>mpatram</dc:creator><description>&lt;p&gt;Try this inside button:&lt;/p&gt;
&lt;p&gt;this will create a separate row in database for each file attached&lt;/p&gt;
&lt;p&gt;saveInto: {&lt;br /&gt; a!forEach(&lt;br /&gt; items: local!loadedFiles,&lt;br /&gt; expression: {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a!save(ri!loadedFiles[fv!index].fileAttached, fv!item)&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/65698?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 06:35:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:512fc228-706a-4469-b360-1391ef4eae3a</guid><dc:creator>Alastr</dc:creator><description>&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;I AM TRYING TO UPLOAD VARIOUS FILES AND THAT THESE FILES ARE SAVED IN MY DATABASE&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/65697?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 04:40:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0a557b5d-12c7-4bc9-bdbe-a3b7fce6a3b9</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Your query is not so clear.&lt;/p&gt;
&lt;p&gt;Do you want to store the documents into KC and store their docId into Appian?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or, are you trying to store the documents directly into the DB? Because file upload fields are&amp;nbsp;not meant for serving this. This allows you store the documents&amp;nbsp; into Appian KC and later you can store the docId&amp;#39;s into the Database.&lt;/p&gt;
&lt;p&gt;Are you trying to refer to Blob?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload several files and save to database</title><link>https://community.appian.com/thread/65692?ContentTypeID=1</link><pubDate>Sat, 06 Apr 2019 00:03:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a2790070-421d-4c20-919b-2041328764f9</guid><dc:creator>Robert Shankin</dc:creator><description>&lt;p&gt;What do you mean when you say you have a field to upload files to a database?&lt;/p&gt;
&lt;p&gt;The file upload field allows you to upload documents into Appian.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>