<?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>How can I save an uploaded file into a Data Model ?</title><link>https://community.appian.com/discussions/f/new-to-appian/39378/how-can-i-save-an-uploaded-file-into-a-data-model</link><description>Hi there， I need your kind support plz ! 
 In my app, there is a Record Type as below: 
 
 I want to use it to store the documents which are uploaded from a!fileUploadField item in an interface. 
 The introduction of a!save() in Documentation of Appian</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can I save an uploaded file into a Data Model ?</title><link>https://community.appian.com/thread/150863?ContentTypeID=1</link><pubDate>Tue, 12 Aug 2025 02:13:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:92a5aa31-ea0f-4107-8823-f9883dadeee7</guid><dc:creator>Jinger Pan</dc:creator><description>&lt;p&gt;Thank you so much for your &lt;span&gt;guidance&lt;/span&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f600.svg" title="Grinning"&gt;&amp;#x1f600;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I save an uploaded file into a Data Model ?</title><link>https://community.appian.com/thread/149607?ContentTypeID=1</link><pubDate>Fri, 04 Jul 2025 06:09:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9d983a98-ee37-441c-b860-7650e581d136</guid><dc:creator>Indhujab</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you want to store the extension of the document (Ex: .pdf, .txt) as document type? If yes, you can use document function as mentioned below and use it in your a!save().&lt;/p&gt;
&lt;p&gt;document(&amp;quot;test_doc&amp;quot;,&amp;quot;extension&amp;quot;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I save an uploaded file into a Data Model ?</title><link>https://community.appian.com/thread/149606?ContentTypeID=1</link><pubDate>Fri, 04 Jul 2025 06:03:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1766d077-0854-478c-ada6-1a7632cc26d9</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/jingp965361"&gt;Jinger Pan&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;the function&amp;nbsp;&amp;nbsp;&lt;span class="nf"&gt;a!documentFolderForRecordType() works when you have Record type to manage documents in your application. Also this function returns the folder where the document should be stored and thus should be used in the &amp;#39;&lt;strong&gt;target&lt;/strong&gt;&amp;#39; attribute of the file upload component which is missing in your code currently.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;There are 2 ways to Manage documents in Appian&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;1.&amp;nbsp;Using Record types&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;2. Using folders&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;Using Record types you will need a separate record type which has document and record id columns to store the document. You can find a detailed documentation and steps &lt;a href="https://docs.appian.com/suite/help/25.2/manage-docs-with-records.html"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;span&gt;a!documentFolderForRecordType() works for this management option and not when you use folders.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;&lt;span&gt;Using folders, we create a folder within the Knowledge center of application where we want to documents to be stored when a user uploads it in interface.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;&lt;span&gt;Here is a working example to store documents using folders. &lt;a href="https://www.youtube.com/watch?v=fIomfjGo4Qs"&gt;Here &lt;/a&gt;is a tutorial to follow to learn about working with documents and records using folders&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="nf"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!file,
  local!submissionSuccessful,
  local!errorCode,
  {
    a!fileUploadField(
      label: &amp;quot;File Upload&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      saveInto: local!file,
      value: local!file,
      /* Replace this with a constant of type Folder in your environment */
      target: cons!AS_DOCUMENTS_FOLDER_POINTER
    ),
    a!buttonArrayLayout(
      buttons: {
        a!buttonWidget(
          label: &amp;quot;Submit&amp;quot;,
          style: &amp;quot;SOLID&amp;quot;,
          /* If you don&amp;#39;t use a!submitUploadedFiles(), the signature will not be uploaded */
          saveInto: a!submitUploadedFiles(
            onSuccess: a!save(local!submissionSuccessful, true),
            onError: {
              a!save(local!submissionSuccessful, false),
              a!save(local!errorCode, fv!error)
            }
          )
        )
      },
      align: &amp;quot;END&amp;quot;
    )
  }
)
&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="nf"&gt;&lt;span&gt;So identify the way you want to establish document management then implement accordingly. Feel free to ask if you encounter any challenges.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>