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 / Use Variable for a Lis...
Power Automate
Answered

Use Variable for a List Name with Get Items, Create Item, Update Item ??

(0) ShareShare
ReportReport
Posted on by 5

I have a flow based on file creation and modification that creates/updates items in lists based on metadata from the file.  There are 25 possible list destinations based on a metadata column.  I use the Switch Case to direct the flow to the corresponding list.  In each Case there is logic that I have to recreate 24 times to use the correct list in get,update,create.  I would like to be able to set a variable in the each Case and write the logic one time using the variable list name in subsequent get,update,create.  Is this possible?  

setvar.jpg
Get Items doesnt seem to mind that a string variable
getitem.jpg

But Create Item complains 
createItem.jpg

Is there a better way?

Categories:
I have the same question (0)
  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @kreeder,

     

    I am afraid that filling in the variable in the List name is not feasible for Create item and Update item.

    Because these two actions need to determine the list name to get the fields that need to be created or updated.

    Maybe you could try using Send an Http request to SharePoint to create Item and Update item.

    I did a test on my side, using Create item as an example:

    16.PNG

    17.PNG

    Updating an Item is similar to creating an Item. Here are some links you can refer to on how to update items using Http request.

    https://veenstra.me.uk/2018/07/02/microsoft-flow-update-a-list-item-with-a-people-field-using-rest-api-in-the-send-an-http-request-to-sharepoint-action/

    https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest

    Please take a try.

     

    Best Regards,

    Barry

  • kreeder Profile Picture
    5 on at

    Thanks I will give it a try.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard