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 / Create new list item a...
Power Automate
Unanswered

Create new list item and get corresponding library file

(0) ShareShare
ReportReport
Posted on by 96

I am trying to create a communications delivery based on entries in a SharePoint list and a library repository which holds files of a variety of formats (PDF, Word, etc.). The trigger occurs when a new item is created in the list. One of the list columns is a lookup to the library title (name of the file). What I am wanting to do is if the library file lookup in the list matches a library item name (which it should because it is a one-to-one match), then attach the library file in an email.

 

I am running into a problem when trying to grab the "Get file content" action's "File identifier" object. Since this is a dynamic form, I don't want to statically select a document, but fluidly select whichever file object is selected. I've tried to use expressions to grab the items('Apply_to_each')?['DisplayName'] from the library, but that didn't work. I think it didn't work because that data object wasn't exposed in the Dynamic Content.

 

Here is a screenshot of my flow:

Flow_Get_File_Content_From_List_Lookup.png

 

Inside my condition I have written two expressions. One to grab the list lookup and the other for the library title:

Library title:

items('Apply_to_each')?['Title']

 

List lookup:

TriggerBody()?['XXXInformation']?['Value']

 

How can I best grab the file that matches my query?

 

 

 

 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @adove 

     

    To select the file using the file identifier, you cannot use the Display Name attribute. You need to use the ID or the Identifer for that. 

     

    In your scenario, you can use the List files action and then in this action you can add a filter query to get the item that has the particluar displayname. (This action returns a list of files but in your case as the files will be uique you will get only one value) you can then add the get file content actions and then add the consecutive steps. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • adove Profile Picture
    96 on at

    I can't get your suggestion to work. Could you provide some examples and screenshots?

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard