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
- Open the SharePoint action (e.g., Retrieve SharePoint list items).
- 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%.
- Do the same for List Name with
%ListName%.
- 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