Upload file to Sharepoint library and set given properties


AddFileToSharepoint("subSiteUrl","web","libraryName","folder","fileName|fieldName|fieldValue","propertyName", "propertyValue", ...);

Function arguments

  • subSiteUrl – (String) Url of the site collection ex. /sites/company. Empty if root site or site collection url is specified in system parameter SharePointUrl.
  • web – (String) Server relative url of Sharepoint web to which file will be added. Empty string for root web.
  • libraryName – (String) Name of the library to which file will be added.
  • folder – (String) Name of the folder in library to which file will be added. Empty string for root folder. If folder does not exists it will be created.
  • fileName|fieldName|fieldValue – (String) File to upload to Sharepoint. It can be passed: case field name (must be UploadFile field), case field value (must be UploadFile field), name of the file from case documents list
  • paramName – (String) [Optional] Name of the Sharepoint list field to be set for added document
  • paramValue – (String) [Optional] Value of the field specified in previous parameter

Return value

This function returns String.
Url of added file


Example 1:
This will add file from [Invoice] field to Sharepoint defined in SharePoint system parameters. File will be added to root web to library Invoices. In this library file will be added to folder with name taken from yearmonth field (ex. 201808). Next two fields: Invoice number and Invoice date will be set on Sharepoint list item assigned to file. Value of this fields will be taken from corresponding case fields. Result will be stored in Url case field.

[Url] = AddFileToSharepoint("", "", "Invoices", [yearmonth], [Invoice], "Invoice number", [Invoice number], "Invoice date", [Invoice date])
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.