I have a flow that is checking an e-mail and saving the attachment (always a PDF) to Google Drive. I would like to rename that file on the save, but having trouble renaming the file based if another Compose (DocumentType) has a certain Word, etc. This is what I have come up with, but I have something missing because it's not renaming the file but it does add the other Compose and Date/Time Stamp.
Here is the expression:
concat(
if(equals(item()?['{DocumentTypeVar}'], 'Configuration Pages'), 'CONF',
if(equals(item()?['{DocumentTypeVar}'], 'Delivery and Acceptance'), 'DA',
if(equals(item()?['{DocumentTypeVar}'], 'Receivables'), 'REC',
if(equals(item()?['{DocumentTypeVar}'], 'Picking and Packing Lists'), 'PICPAK', replace(item()?['Name'], '.pdf', '')
)
)
)
),
'-',
outputs('SerialNumberVar'),
'-',
formatDateTime(utcNow(), 'MMddyyyy'),
'.pdf'
)