
Announcements
In this 3-action flow:
where the compose is
last(split((outputs('Get_attachments')?['body/DisplayName'], '.'))
I get
InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.'.
Yet very clearly the body of the output contains the string?!?!!?
Hi @tpcolson
That expression doesn't look quite right.
First of all the Get attachments action produces an array of records even if there's only one attachment, so you have to select one record.
Then you can perform the split on the DisplayName.
So to get the file extension of the last attachment in the array, you can use:
last(split(last(outputs('Get_attachments')?['body'])?['DisplayName'],'.'))