Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

How to get the name of a List?

(0) ShareShare
ReportReport
Posted on by 343

I would like to include the name of an MS List in the subject of an email so that the recipient knows which list this email is about. I am using a recurrence flow to compile the daily changes that have occurred in a list and then sending out emails in Apply to Each to the various people assigned to those changes.

 

I thought since I manually specify the List in Get Items that I could simply initialize a variable with Name from this but when trying the variable is automatically put inside another Apply to Each. Since the flow only concerns one List I'm sure this is not the right way. How do I go about this?

 

Power_Automater_0-1644286261658.png

 

  • Power_Automater Profile Picture
    343 on at
    Re: How to get the name of a List?

    Ok I tried this and it works great so thank you. I am just wondering though if it is possible to get the list name via a Calculated Column in Lists, since then it would automatically be accessible after the Get Items action. I've tried to search for the formula but haven't found anything.

    Or I suppose I could add it manually and then use something below to retrieve it from a filter array (where field_3 is the name of the column with the list name in it):
    body('Filter_array_2')?[0]?['field_3']

  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: How to get the name of a List?

    Hi @Power_Automater,

     

    As far as I am aware there are only two actions which interact with lists and both of them retrieve all items and don't have a filter capability. That's why I used the approach with the built in Send an HTTP request to SharePoint action.

     

    lists_action.png

     

    Btw, another approach would be to extract it from one of the fields in the output of your get items. This means you don't have to add an additional action. 

     

    Below is an example of that second approach.

    This expression only works if the get items action returns at least one item. It gets the path property and splits on / to retrieve the list name of the value.

     

     

     

    split(outputs('Get_items')['body/value'][0]['{path}'], '/')[1]

     

     

     

    listname_outputs_fullpath.png

     

  • Power_Automater Profile Picture
    343 on at
    Re: How to get the name of a List?

    Thank you @Expiscornovus I will give this a try later today and let you know how I go. Is there really no built in action in Automate/Flow to get the name/title of a list? It seems strange that it is possible to get all of the list data in each row and column but not the name of the list itself.

  • Verified answer
    Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: How to get the name of a List?

    Hi @Power_Automater,

     

    You could reuse what you have selected in the Get Items. This is stored as one of the input parameters. However, the challenge is that it is stored with the GUID of the list and not the actually name. You can workaround this by using a Send an HTTP request action to retrieve the title.

     

    Below is an example of that approach.

    The Send an HTTP request actions uses a GET method to retrieve the properties of your selected list in the Get Items. In this example I am only returning the Title. Which will be stored in a string variable in the action after that.

     

    _api/web/lists(guid'@{actions('Get_Items')['inputs']['parameters']['table']}')?$select=Title

     

    inputparameters_table.png

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,653 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow