I am currently working on a Power Automate flow that should take emails from a shared inbox and move them over to smartsheet along with their attachments.
Power Automate does not have a template to move attachments over to smartsheet, so I was going to use smartsheet's API to move the attachments over.
However, using the Smartsheet REST API and the contentBytes provided in Power Automate, it doesn't move attachments over properly and I am unable to view the file in smartsheet.
Below is the code i was using in Power Automate:
"method": "POST",
"uri": "https://api.smartsheet.com/2.0/sheets/[sheetId]/rows/[rowId]/attachments",
"headers":
{
"Content-Type": "['contentType']",
"Content-Length": "['size']",
"Content-Disposition": "attachment; filename=\"['name']\""
},
"body": "['contentBytes']",
This was in an "apply to each" method so it would work for each attachment.
My only guess is its cutting the contentBytes short somewhere so its not moving the full attachment over and thats why it cant be opened? But im not sure where to go from here.
Power Automate has some problems while transporting the file meta. Try add the file itself to a variable and transform the content of the file to a base64 content like below.