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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / File name matches user...
Power Automate
Answered

File name matches user name, send file to user... Compose Expression issues...

(0) ShareShare
ReportReport
Posted on by
  1. Sharepoint folder with files, where the filename matches a user (for example: Jane Doe.xlsx)
  2. Want to send the matching file to each user, based on the matching of file name (minus the .xlsx)
  3. Using "get file properties" and then 'apply to each' where first step is a compose with this expression: 

 

substring(item()?['Name'],0,indexOf(item()?['Name'],'.'))​

 

Which generates this error: "Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'indexOf' expects its first parameter to be of type string. The provided value is of type 'Null'."

 

I'm stuck.... any suggestions are appreciated!

 

Capture10.PNG

Categories:
I have the same question (0)
  • Verified answer
    bentorrey Profile Picture
    15 on at

    If I'm understanding the issue correctly, you shouldn't need to do any substring() there. As you're going through the loop, you can use the Name property to get the file without extension. FileNameWithExtension is sometimes handy, as is FileLeafRef, but in this case, I'd just grab that Name directly and go on to your user lookup for the email. That should already be the file name minus extension.

     

    file name.png

  • Murphys110 Profile Picture
    on at

    Thanks for that! Not long after I posted, I decided to just do a separate flow with "when a file is created" as trigger. I've finally started reviewing the outputs of flows to see what the actual parameters read behind the scenes, and also noticed the name field. It works well, but I will be using your solution when I get around to tightening up the process.

    Thanks!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard