PowerAutomation Get email attachments and create ticket

I create a flow in Powerautomation. I want when an email arrives in a certain shared mailbox to create a ticket in helpdesk.
Your documenation example has a compose function
where in jsn file composeplumsailexample
has: {
"Name":",
"AttachmentContent":
}
I try to compose from email using the variables from Email
{
"Name":",
"AttachmentContent":
}


But I get the error: {"attachments[0].AttachmentContent":["The input was not valid."]}
when I run the flow.
Which Variables I have to use from the trigger when a new message arrives in order to create the ticket with the attachment?
Thanks for the help

Hello Nick! For some reason, the file content from Outlook actions can't be processed. Please save the attachments in cloud storage (or SP library), then get their content with the accordant action and pass it to the Compose action.

I will consult with developers regarding this issue, whether it is our or Outlook bug.

Hi :slightly_smiling_face:
Finally it was in the compose a decodeBase64 in the AttachmentContent object and it worked!
Now the problem is that after we do an update to the parent ticket we need to use plumsail power actions in order to create a new related ticked where the requester of this new ticket is the assignee of the already created ticket with the attachment. So we need at the post command Create ticket to have in this ticket attached the attachment in order to delivered to the external associate who is in the cc of the ticket. So I suppose we need to get the attachment of the parent ticket and attached it to the newlly created. I suppose we need to retrieve it from the sharepoint list tickets. Do you have any guide ready in order to save a few hours of sleep?
Thanks and Best Regards

1 Like

I am not sure that understand how your flow should look like. But in general, yes, you can do all this using the default SharePoint actions as far as you have an ID of the parent ticket:

  1. Get attachments, then their content and compose the object to append it to an array variable and pass then to the HelpDesk action:

  1. Get item (parent ticket) and use the assignee's e-mail as a requester in the HelpDesk action for creating a ticket.

Here is one of the output values:

image

Can you tell me which field from Get attachment Content I have to compose for the AttachmentContent parameter which can work the the Array for the Attachment parameter in the Create Ticket Action?
Thanks.

Please use the Attachment Content property:

When creating a ticket, you can specify the assignee from the previous one as a requester of the new one, the attachments can be passed as an array:

An overview of the simple test flow:

Unfortunately the action Create ticket fails as you can see.


It seems that in Compose we need to put the attachment content field of the Get attachment content sharepoint action with some kind of conversion which I try to find but I can't. Any advice?
Thx

It should work without any conversion, just as it is shown on the screenshot (I tested it). On the provided screenshot, there is no JSON object: instead of braces, you used parentheses. Also, you passed the entire input as a string and the values of the properties are not taken in quotes:

image

Here is how the input of the HelpDesk action looked in my case:

[
  {
    "Name": "1.png",
    "AttachmentContent": {
      "$content-type": "image/png",
      "$content": "bnVsbA=="
    }
  },
  {
    "Name": "2.png",
    "AttachmentContent": {
      "$content-type": "image/png",
      "$content": "bnVsbA=="
    }
  }
]

Please ensure, that you composed the object properly.

Yes it is ok :slight_smile:

1 Like