web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using compose to get a...
Power Automate
Unanswered

Using compose to get attachment file extension from get attachments fails

(0) ShareShare
ReportReport
Posted on by 80

In this 3-action flow: 

 

tpcolson_0-1713440954548.png

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?!?!!?

 

tpcolson_1-1713441176720.png

 

Categories:
I have the same question (0)
  • Verified answer
    DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    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'],'.'))

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard