// This module is included in the following assemblies:
// as_connecting-to-dropbox.adoc

[id='adding-dropbox-connection-middle_{context}']
= Accessing Dropbox in the middle of an integration

To upload a file to Dropbox in the middle of a flow,
add a Dropbox connection to the middle of the flow. 

.Prerequisites
* You created a Dropbox connection.
* You are creating or editing a flow and {prodname} is prompting you
to add to the integration.

.Procedure
. On the *Add to Integration* page, click the plus sign where you 
want to add the connection. Skip this step if {prodname} is
prompting you to choose the finish connection. 
. Click the Dropbox connection that you 
want the integration to use. 

. On the *Choose an action* page, select *Upload* to 
add the current integration data to the
Dropbox account that this connection accesses. 
. Configure this action:
.. In the *Remote Path* field, specify the local path and 
file name of the file that you want to upload. Dropbox stores the file with the 
same path and name. In this release, you can upload only a single file. 
.. For the *Upload mode*:
+
** Select *Add* to upload a file only when a file with the same name is not already
in the same Dropbox folder. If a file with the same name is already
in the same Dropbox folder, then the file is not uploaded and the integration continues.
This is the behavior regardless of whether the content in the file you are trying to
upload has been updated. 
** Select *Force* to ensure that the file is uploaded even if a file with the
same name is present in the same Dropbox folder. Dropbox overwrites the file
that it already has with the file that you are uploading. 
 
. Click *Next* to specify the action's input and output type. 

. In the *Select Type* field, if the data type does not need to be known, 
accept *Type specification not required* 
and click *Next*. You do not need to follow the rest of these
instructions. 
+
However, a structured data type is recommended. For example, if you want 
to map the connection input/output in a data mapper step then you must specify 
the data type. The data mapper cannot display fields for unstructured data.
+
To specify the data type, click in the *Select Type* field and select one of the following as the schema type:
+
* *JSON schema* is a document that describes the structure of JSON data.
The document's media type is `application/schema+json`. 
* *JSON instance* is a document that contains JSON data. The document's 
media type is `application/json`. 
* *XML schema* is a document that describes the structure of XML data.
The document's file extension is `.xsd`.
* *XML instance* is a document that contains XML data. The
document's file extension is `.xml`. 
* *CSV instance* is a document that contains comma-separated value (CSV) data. The document's file extension is `.csv`. 
ifeval::["{location}" == "downstream"]
+
*Note* _Data Mapper support for CSV data is a Technology Preview feature only._
endif::[]

. In the *Definition* input box, paste a definition that conforms to the
schema type you selected. 
For example, if you select *JSON schema* then you would paste the content of
a JSON schema file, which has a media type of `application/schema+json`.

. In the *Data Type Name* field, enter a name that you choose for the
data type. For example, if you are specifying a JSON schema for
vendors then you might specify `*Vendor*` as the data type name. 
+
You will see this data type name when you are creating 
or editing an integration that uses the connection
for which you are specifying this type. {prodname} displays the type name
in the integration visualization and in the data mapper. 

. In the *Data Type Description* field, provide information that helps you
distinguish this type. This description appears in the data mapper when 
you hover over the step that processes this type. 
. Click *Next*. 

.Result
The connection appears in the integration flow 
where you added it. 
