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 / Power Automate matchin...
Power Automate
Answered

Power Automate matching part of file name to reference in SharePoint list

(0) ShareShare
ReportReport
Posted on by 6

Hope this is the right place to post this interesting headache I've given myself 😉

Trying to automate the process of emailing budget sheet updates to our team

 

Have files which are named to include dept codes (FoE, FoB, C1, C2, C3 etc) along with date e.g. "Budget Update FoB 06 December"

All the dept codes are on a SharePoint list with emails of the team in that dept. (list is just populated with my name during testing)

 

What I'm trying to build is a flow where I add these files into a specific SharePoint folder each month and based on the match to the SharePoint list, it then emails the right dept with the file. 

Familiar with how to email the files when they are added, but struggling with how to filter based on the name containing the matched data

 

screen shots attached of what I've tried so far, which keep giving me the error expression "Contains(Budget Update FOB 06 December,FOB)" is not valid. Have also tried using a condition filter within the flow, but it only achieves a non-match

Both the conditions I'm trying to match are dynamic, file name and contains 'list title' - could this be why?

 

if anyone can help point me in the right direction, I would be very very grateful! 

 

SharePoint List

Sharepoint List.jpg

Flow pt1.jpg

Flow pt2.jpg

Flow pt3.jpgError.jpg

Categories:
I have the same question (0)
  • v-chengfen-msft Profile Picture
    on at

    Hi @palfreya ,

    Do you want to filter on Title with containment?


    In sharepoint please use substringof()

    Please try :

    substringof('Budget Update FOB 06 December', Title)

     

    'Budget Update FOB 06 December' can use dynamic content,

    for example:


    substringof('dynamic content', Title)


    Note: (Remember to add single quotes around the dynamic content)

     

    Here is link about Filter Query for your reference:

    Power Automate OData filter query with examples - SPGuides

     

     

     

    Best Regards

    Cheng Feng

  • palfreya Profile Picture
    6 on at

    thanks so much for the reply

     

    I've tried this, and now get a slightly different error. It now looks like it's looking for a column called FOB instead of matching the item in the Title column matching "FOB" ? Once it finds the Match, I'm planning for the flow to pick up the email addresses in the person column for that line 

     

    Screenshot 2022-12-07 084727.jpg

  • v-chengfen-msft Profile Picture
    on at

    Hi @palfreya ,

    Judging from the picture you provided, the FOB is stored in the Title column

     

    This Title represents the SharePoint column name.


    The meaning of this formula is: filter out items that contain "dynamic content" in the sharepoint list Title

    substringof('dynamic content', Title)

     

    Here is link about how to use Filter Query for your reference:

    Power Automate OData filter query with examples - SPGuides

     

     

    Best Regards

    Cheng Feng

  • palfreya Profile Picture
    6 on at

    Ahh! I see! So how would I be able to find the match within the column instead of looking for a column called "fob"

  • v-chengfen-msft Profile Picture
    on at

    Hi @palfreya ,

    Do you want to get files based on whether the file name contains the value of the Title column in the Sharepoint list?

    Please try:

    substringof('Title', FileLeafRef)

     

    Here is a link for your reference:

    Solved: Filter Query by File Name (Get files properties on... - Power Platform Community (microsoft.com)

     

    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

    Best Regards

    Cheng Feng

  • palfreya Profile Picture
    6 on at

    It's not really filtering it at all, if I upload 1 file with name containing "fob", I get 5 emails (the same number as the total number of records in the list, although only 1 of those contains "fob"

    At the moment I'm only putting my own email it the 'send email' section rather than selection from the list as planned at the moment

    The intention is that the file only sends once, but eventually to the names in the person column on the matched SharePoint list 

     

    08f07a6b-7716-47e1-95d9-94ab368e62df.jpg

    Screenshot 2022-12-07 101555.jpg

  • Verified answer
    v-chengfen-msft Profile Picture
    on at

    Hi @palfreya ,

    I thought you should use substringof('FileName', Title) for Get items, but what you want to get is the file name with "FOB".
    Please use Filter Array

    Here is test for your reference:

    vchengfenmsft_1-1670923628402.png

    User Item() get item value:

    vchengfenmsft_2-1670923682479.png

     

    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

    Best Regards

    Cheng Feng

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard