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 / Sharepoint Action Get ...
Power Automate
Suggested Answer

Sharepoint Action Get Items in PAD cannot use variable

(4) ShareShare
ReportReport
Posted on by 159 Season of Giving Solutions 2025
Hi,
 
The SharePoint action get items in PAD does not work on variables when defining the site address and list name. Compared with cloud flows.
 
What i do now is create a switch condition and pass an IN variable from a cloud flow to determine my environment. ex. DEV, PROD.
 
 
Wondering if anyone had any other approach for this in PAD
I have the same question (0)
  • Suggested answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 1 on at
    Hi @
     
    In Power Automate Desktop, the SharePoint Get items action does not seem to work reliably when variables are used for Site address and List name. This is different from cloud flows, where dynamic values or environment variables can be used more easily.
     
    As a workaround, I currently pass an input variable from the cloud flow to the desktop flow to identify the environment, for example DEV, UAT, or PROD. Then, inside Power Automate Desktop, I use a Switch condition based on that input variable. Each case contains a separate SharePoint Get items action with the corresponding hardcoded site address and list name for that environment. This works, but it creates duplicated actions.
     
    There is also another solution on the forum Dynamic variables (Share point action)
     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    SpongYe Power Platform Enthusiast [LinkedIn] | [Youtube| [My blog]

     

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my blog [@SpongYe] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Suggested answer
    RaghavMishra Profile Picture
    261 on at

    Hi,

    The Site Address and List Name fields on the PAD SharePoint actions do accept variables — they're plain text inputs under the hood, even though the UI presents them as a picker. The trick is that the picker dropdown swallows the typing, so you have to enter the variable a different way.

    How to pass a variable into Site Address / List Name in PAD

    1. Open the SharePoint action (e.g., Retrieve SharePoint list items).
    2. In the Site Address field, click the {x} variable icon on the right of the input (not the dropdown arrow) and pick your variable — e.g., %SiteUrl%.
    3. Do the same for List Name with %ListName%.
    4. At design time the field will look "empty" because the dropdown can't render a variable preview, but at runtime PAD substitutes the value. Reference: SharePoint actions in Power Automate for desktop and Variables in Power Automate for desktop.

    A cleaner pattern for DEV / PROD switching

    Instead of a Switch action inside the desktop flow, externalize the environment config so the same flow runs unmodified in DEV and PROD:

    • Use input variables on the desktop flow and pass SiteUrl + ListName from the calling cloud flow. The cloud flow picks the right values per environment from a Dataverse Environment variable, which Microsoft's ALM guidance recommends specifically for cross-environment configuration. References: Use input and output variables in desktop flows and Environment variables overview.
    • If the desktop flow is run directly (not triggered by a cloud flow), read the values from a config file at the start of the flow — Read text from file + Convert JSON to custom object — and assign them to %SiteUrl% / %ListName%. See File actions and Convert JSON to a custom object.

    If the variable approach still won't bind

    Some older versions of the PAD SharePoint actions force the dropdown and reject typed input. In that case, the documented workaround is to call SharePoint via REST instead of the connector action — the Invoke web service action accepts any variable for URL and body, and you keep one code path across environments:

    • Invoke web service%SiteUrl%/_api/web/lists/getbytitle('%ListName%')/items, method GET, accept header application/json;odata=nometadata.
    • Authenticate using a Microsoft Entra app registration; the Invoke web service action documents the supported auth modes.
    • Reference: HTTP actions in Power Automate for desktop and SharePoint REST service.

    Net: try the {x} variable picker first — that's almost always all you need. If you're already calling the PAD flow from a cloud flow, lift the Switch out of PAD and into the cloud flow's Environment variable, which is the supported ALM path and saves you maintaining the Switch in two places.

    Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!

    Raghav Mishra — LinkedIn | PowerAI Labs

  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Use Environment Variables in Cloud Flows
     
    Environment variables work much better in cloud flows than PAD for:
    • Site URL,
    • List Name,
    • tenant-specific configuration.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard