Skip to main content

Profile Form Linking Documentation

When uploading a file to the Synergy environment, you can follow these steps to link a profile form:

Requirements

  1. Project ID Information: Get the ID value of the project by filtering by the 'NAME' column from the 'PROJECTS' table in the database.
  2. Form ID Information: Get the ID of the form by filtering the 'PROJECTID' and 'NAME' columns from the 'PROJECTFORMS' table. The column 'NAME' in the 'PROJECTFORMS' table corresponds to the form name.

Steps

1. Getting the Project ID Value

'''SQL SELECT ID FROM PROJECTS WHERE NAME = 'Project Name'


### 2. Getting the Form ID Value
'''SQL
SELECT ID
FROM PROJECTFORMS
WHERE PROJECTID = 'ProjectID'
AND NAME = 'Form Name'

3. Creating a List from the CreateFileDocumentItem Object

  • 'CreateFileDocumentItem' objects are created with the project name, form name, document ID, form ID, and project ID information.

'''csharp List<CreateFileDocumentItem> profileFormList = new List<CreateFileDocumentItem>(); profileFormList.Add(new CreateFileDocumentItem{ ProjectName = "SOS_ProfileFormExampleProject", FormName = "ExampleProfileForm", DocumentId = 4794, FormId = "d0b8a7a2-de28-4a95-b6e0-3927ca9512fd", ProjectId = "4b5c6b72-b570-4b2c-8eaf-f5d82301f105" });


### 4. Creating a CreateFileRequest Object and Linking a File
- The profile form is linked to the file by creating the 'CreateFileRequest' object.

'''csharp
CreateFileRequest createFileRequest = new CreateFileRequest(
folderSecretKeyResult.Data,
fileContentInfo,
createFileModel.Name,
createFileModel.Description,
profileFormList,
Null
);
WrapResponse```<```GetDMObjectResponse```>``` createFileResponse = _synergyHelper.ServiceApi.DocumentManagement.CreateFile(createFileRequest). Result;

By following these steps, a profile form can be linked to a file in the Synergy environment.

Sample Code

'''csharp List<CreateFileDocumentItem> profileFormList = new List<CreateFileDocumentItem>(); profileFormList.Add(new CreateFileDocumentItem{ ProjectName = "SOS_ProfileFormExampleProject", FormName = "ExampleProfileForm", DocumentId = 4794, FormId = "d0b8a7a2-de28-4a95-b6e0-3927ca9512fd", ProjectId = "4b5c6b72-b570-4b2c-8eaf-f5d82301f105" });

CreateFileRequest createFileRequest = new CreateFileRequest( folderSecretKeyResult.Data, fileContentInfo, createFileModel.Name, createFileModel.Description, profileFormList, Null );

WrapResponse<GetDMObjectResponse> createFileResponse = _synergyHelper.ServiceApi.DocumentManagement.CreateFile(createFileRequest). Result;