--- title: "Add File Reference To Current Import Session" slug: "add-file-reference-to-current-import-session" tags: ["File References", "import session"] updated: 2022-12-27T16:40:23Z published: 2022-12-27T16:40:23Z canonical: "documentation.decisions.com/add-file-reference-to-current-import-session" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Add File Reference To Current Import Session | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 5.0.0 | | **Location** | System > Advanced > Import - Export | The **Add File Reference To Current Import Session** allows a user to add a file reference to an import session. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | File Reference | File Reference to be added with session | FileReference | | Import Session Id | Import session Id | String | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Output | Import session entity | List of ImportSessionEntity | --- ## Example Inputs and Outputs | FileName | Id | Size | Import Session Id | Output | | --- | --- | --- | --- | --- | | Null | Null | 2 | StartImportSession1_Output | EXCEPTION MESSAGE | | Airports.txt | b0ef2ded-8937-435c-98a6-60b13799d4d4 | 95943 | StartImportSession1_Output | Import Session Entity Data | #### ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1672159212893.png) --- ## Common Errors ### Object reference not set to an instance of an object If the input values for the file reference are not set correctly, an error will occur. To correct this, ensure that the fields for the FileReference field are set correctly. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Add File Reference To Current Import Session 1[AddFileReferenceToCurrentImportSession] in flow [Flow 2]: Exception invoking method AddFileReferenceToCurrentImportSession on class ImportExportSteps ---> DecisionsFramework.LoggedException: Exception invoking method AddFileReferenceToCurrentImportSession on class ImportExportSteps ---> System.NullReferenceException: Object reference not set to an instance of an object. at DecisionsFramework.ServiceLayer.Services.FileReference.FileReferenceService.GetRelativeDirForFile(String idOrName at DecisionsFramework.ServiceLayer.Services.FileReference.FileReferenceService.GetFilePathFromIdOrName(String idOrFullNameWithId, Nullable`1 fileDateTime, Boolean includeDeprecatedDirs, Boolean searchAllDirectories at DecisionsFramework.ServiceLayer.Services.FileReference.FileReferenceHandler.GetData(FileReference fileReference, Int32 offset, Int32 chunkSize at DecisionsFramework.ServiceLayer.Services.FileReference.FileReferenceService.GetData(AbstractUserContext user, FileReference fileReference, Int32 offset, Int32 chunkSize at DecisionsFramework.ServiceLayer.Services.FileReference.FileReference.get_Data( at DecisionsFramework.ServiceLayer.Services.ImportExport.ImportExportSteps.AddFileReferenceToCurrentImportSession(String importSessionId, FileReference fileReference) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` ## Related - [Get FileReferences in Folder](/get-filereferences-in-folder.md) - [Add File References To Folder](/add-file-references-to-folder.md) - [Start Import Session](/start-import-session.md) - [Publish File To Server](/publish-file-to-server.md)