You cannot really do this via the user interface, but you can modify the code behind the action in a text editor. First, set up the action by using direct (non-dynamic) inputs, and save it. Then copy the action and paste it to a text editor. Then edit the site address and / or list name fields to contain variables, and then paste the code back to the designer.
This works, and I have tested this several times. I have, for example, done the same thing in my PAD Framework, where I have the Logger utility flow that logs to a dynamic SharePoint lists. See here: https://github.com/AgniusBartninkas/power-automate-desktop-framework
The code could look somewhat like this when you set it up normally:
@@dataset: 'Agnius - https://{sanitized}.sharepoint.com/sites/Agnius'
@@table: 'Log Messages'
@@view: ''
@@'InputSchema:item': '903008207'
@@'OutputSchema:PostItemResponse': '-1550202392'
@@connectionDisplayName: 'PADFramework_SharePoint'
External.InvokeCloudConnector Connection: '{sanitized}' ConnectorId: '/providers/Microsoft.PowerApps/apis/shared_sharepointonline' OperationId: 'PostItem' @dataset: $'''https://{sanitized}.sharepoint.com/sites/Agnius''' @table: $'''3022b5be-1478-47bd-baa8-d7e37b70e7cb''' @'item/Title': Log_Level @'item/Timestamp': Log_Timestamp @'item/Machine': Log_MachineName @'item/Project': Input_ProjectName @'item/Flow': Input_FlowName @'item/Subflow': Log_SubflowName @'item/Message': Log_Message @PostItemResponse=> PostItemResponse
# [ControlRepository][PowerAutomateDesktop]
{
"ControlRepositorySymbols": [],
"ImageRepositorySymbol": {
"Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}",
"ImportMetadata": {},
"Name": "imgrepo"
},
"ConnectionReferences": [
{
"ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
"DisplayName": "PADFramework_SharePoint",
"InternalId": "{sanitized}",
"IsDisabled": false,
"LogicalName": "def_PADFramework_SharePoint",
"IsEmbedded": false,
"ConnectionName": "{sanitized}",
"ConnectionDisplayName": "{sanitized}"
}
]
}
But then you can replace the values for dataset and table with variables, and it would look somewhat like this:
@@dataset: '%Input_LogAddress%'
@@table: '%Input_LogAddress%'
@@view: ''
@@'InputSchema:item': '903008207'
@@'OutputSchema:PostItemResponse': '-1550202392'
@@connectionDisplayName: 'PADFramework_SharePoint'
External.InvokeCloudConnector Connection: '{sanitized}' ConnectorId: '/providers/Microsoft.PowerApps/apis/shared_sharepointonline' OperationId: 'PostItem' @dataset: Input_LogAddress @table: Input_LogPath @'item/Title': Log_Level @'item/Timestamp': Log_Timestamp @'item/Machine': Log_MachineName @'item/Project': Input_ProjectName @'item/Flow': Input_FlowName @'item/Subflow': Log_SubflowName @'item/Message': Log_Message @'item/FlowRunURL': $'''%''%''' @PostItemResponse=> PostItemResponse
# [ControlRepository][PowerAutomateDesktop]
{
"ControlRepositorySymbols": [],
"ImageRepositorySymbol": {
"Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}",
"ImportMetadata": {},
"Name": "imgrepo"
},
"ConnectionReferences": [
{
"ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
"DisplayName": "PADFramework_SharePoint",
"InternalId": "{sanitized}",
"IsDisabled": false,
"LogicalName": "def_PADFramework_SharePoint",
"IsEmbedded": false,
"ConnectionName": "{sanitized}",
"ConnectionDisplayName": "{sanitized}"
}
]
}
This works when you paste it back into the designer, as long as you don't open the action there (or if you do open it, do not save changes, as that will clear the dynamic fields, and you'll need to go through the process again).