I am using the DownloadAttachment
action on the SharePoint Connector with the following default configuration:
{
"RemoteFile": "/sites/xyz/Shared Documents/General/sharepoint-file.txt",
"HasBytes": false
}
From the logs, I can see that the generated URL for the request is correct:
[11123|Q-Id] [HTTP|Req: 11490] GET (@v)/$value?@v='%2Fsites%2Fxyz%2FShared%20Documents%2FGeneral%2Fsharepoint-files.txt'
The request also successfully goes through, as seen in the logs:
[11123|Q-Id] [HTTP|Res: 11490] HTTP/1.1 200 OK, 3129 Bytes Transferred
The number of bytes matches the file size, and I can download the file manually using the URL in a browser. However, the integration fails to fetch the file, and no Content
field is set in the response. The output of connectorOutputPayload()
is:
[
{
"Success": "False"
}
]
I expected connectorOutputPayload()
to return the Content
field with the file data, but it does not. There are no errors in the logs either.
200 OK
response and the correct byte count.Content
field missing from connectorOutputPayload()
?HasBytes: false
be affecting the response?Any insights would be greatly appreciated!
I am using the DownloadAttachment
action on the SharePoint Connector with the following default configuration:
{
"RemoteFile": "/sites/xyz/Shared Documents/General/sharepoint-file.txt",
"HasBytes": false
}
From the logs, I can see that the generated URL for the request is correct:
[11123|Q-Id] [HTTP|Req: 11490] GET https://mydomain.sharepoint.com/sites/xyz/_api/web/GetFileByServerRelativeUrl(@v)/$value?@v='%2Fsites%2Fxyz%2FShared%20Documents%2FGeneral%2Fsharepoint-files.txt'
The request also successfully goes through, as seen in the logs:
[11123|Q-Id] [HTTP|Res: 11490] HTTP/1.1 200 OK, 3129 Bytes Transferred
The number of bytes matches the file size, and I can download the file manually using the URL in a browser. However, the integration fails to fetch the file, and no Content
field is set in the response. The output of connectorOutputPayload()
is:
[
{
"Success": "False"
}
]
I expected connectorOutputPayload()
to return the Content
field with the file data, but it does not. There are no errors in the logs either.
200 OK
response and the correct byte count.Content
field missing from connectorOutputPayload()
?HasBytes: false
be affecting the response?Any insights would be greatly appreciated!
Though text files are not generally considered binary files, you can still try to set the HasBytes:false
into HasBytes:true
to instruct the connector that it should treat the response as binary data and return it in the Content field, encoded as base64.z. Otherwise, you can eliminate the HasBytes:false as stated in to this example of downloading an attachment:
{
"RemoteFile": "/sites/xyz/Shared Documents/General/sharepoint-file.txt"
}