I am creating a workflow that is generated from a form, saves all responses to a SharePoint list, initializes the first approval, initializes a 2nd approval, and ultimately emails the appropriate people. The flow worked until it was determined we need to give the submitter the option of attaching a file to their request. I've got the workflow working when an attachment is included, however, when the submitter does not include an attachment, I get " The request failed. Error code: 'InvalidAttachmentName'. Error Message: 'The attachment name '' is invalid.'."
Do I have to create a condition where if hasAttachment variable = true run the approval with the attachments and if not, run the approval without the attachment? Is there some function I'm not aware of that will help handle a null value in the JSON objects for approval attachments?
requestor variable = variables('Request_Data')['Submitter']['Email']
attachment name = variables('Request_Data')['Attachment']['Name']
attachment file = variables('Request_Data')['Attachment']['Full']
