The Additional Files feature allows you to provide files to your integration or configuration without storing them in the project itself (as you do with Project Attachments). This means you can have different versions of the file during design and execution on the DataCloud.
For example, you can use a file as a lookup table during design and then provide a different version of that file for each configuration after deployment.
Use the Additional Files feature for files that need to change frequently or need to differ between configurations. Project Attachments work best for static files; the entire project must be repackaged from DataConnect and then redeployed to DataCloud if an attachment changes. The advantage to using Project Attachments is that the deployment process saves previous versions of your attachment files. When you replace a file in the Additional Files, it overwrites the previous version.
Designing to Use Additional Files
Additional Files are only available during execution on the DataCloud. During the on-premise design phase, use a local repository to store the files required for integration and create a macro containing the path to the local repository.
After you package and deploy your project to the DataCloud, the EXECUTION_PATH_HOME macro in your project accesses files in the Additional Files location for your configuration.
The EXECUTION_PATH_HOME macro is system-generated and is available without any further action.
In a Script step, you can use the following code to read in a text file from Additional Files. The script determines whether you are executing during design or after deployment to DataCloud by checking for the EXECUTION_PATH_HOME.
You can also use your local repository macro during design and then change the macro to EXECUTION_PATH_HOME before you package and deploy your project.
After you have packaged and deployed your project, add the lookupFile.txt file to the Additional Files for the integration or configuration.
You can add Additional Files to an integration or to a configuration. If you have an identically named file on the integration and the configuration, the file on the configuration takes precedence. Otherwise, the Additional Files from the integration are used for each configuration.
In this example, we will use Additional Files to provide a file to use as a source dataset for a map.
Add the file to your local file system.
Create a macro containing the path to the file (e.g., LOCAL REPO).
Create your source dataset. Use your macro to specify the location for the file: $(LOCAL_REPO)/myFile.csv
Once you are finished testing and have determined that the source file works as intended, change the file location to use the EXECUTION_PATH_HOME macro and then save the source dataset: $(EXECUTION_PATH_HOME)/myFile.csv
Package and deploy your project to DataCloud.
Execution on DataCloud
In the management console, create a new integration using the package you just deployed.
Add the file from your design to the Additional Files for the integration. The file must have the same file name.
To provide different versions of the file, you can create multiple configurations and use different files in the Additional Files for each configuration. In each configuration, make sure the file name is identical to the name you provided when you set up your source dataset.