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 Apps / pac code add-data-sour...
Power Apps
Answered

pac code add-data-source fails with "Invalid URI format" for SharePoint connector

(0) ShareShare
ReportReport
Posted on by 28
 
I'm trying to add a SharePoint data source to a Power Apps Code App using the pac code add-data-source command, but it consistently fails with "Invalid URI format" error regardless of the dataset URL format I use.
 
Environment:
PAC CLI Version: 1.50.1+gabb74d2 (.NET Framework 4.8.9221.0)
OS: Windows 11
Feature: Power Apps Code Apps (Preview)

What I'm trying to do:
Connect a Code App to a SharePoint list using the SharePoint Online connector.
 
Steps I've taken:
Created and authenticated with Power Platform:
pac auth create --environment {my-environment-id}

Initialized the code app:
pac code init --displayName "My App"
Verified my connection exists:
pac connection list
Output shows my SharePoint connection with status "Connected"
Retrieved the Table ID by creating a canvas app, adding the SharePoint connection to a gallery, and inspecting the network traffic. Found the table GUID in the API hub URL.
Attempted to add the data source with multiple URL format variations:

Commands Attempted (all failed with same error):
# Attempt 1: Full URL with https
pac code add-data-source -a "shared_sharepointonline" -c "{connection-id}" -t "{table-guid}" -d "https://mytenant.sharepoint.com/sites/MySite"
# Attempt 2: URL encoded
pac code add-data-source -a "shared_sharepointonline" -c "{connection-id}" -t "{table-guid}" -d "https%3A%2F%2Fmytenant.sharepoint.com%2Fsites%2FMySite"
# Attempt 3: Without protocol
pac code add-data-source -a "shared_sharepointonline" -c "{connection-id}" -t "{table-guid}" -d "mytenant.sharepoint.com/sites/MySite"
# Attempt 4: Comma-separated format (like SQL example in docs)
pac code add-data-source -a "shared_sharepointonline" -c "{connection-id}" -t "{table-guid}" -d "mytenant.sharepoint.com,sites/MySite"
# Attempt 5: Just site name
pac code add-data-source -a "shared_sharepointonline" -c "{connection-id}" -t "{table-guid}" -d "MySite"
# Attempt 6: Using just GUID portion of connection ID
pac code add-data-source -a "shared_sharepointonline" -c "{guid-only}" -t "{table-guid}" -d "https://mytenant.sharepoint.com/sites/MySite"
 
Questions:
 
  1. What is the correct format for the -d (dataset) parameter for SharePoint?
  2. Is this a known bug in PAC CLI version 1.50.1?
  3. Are there any workarounds to add SharePoint as a data source to a Code App?
Documentation Reference:
I followed the steps in: https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/connect-to-data The documentation shows examples for SQL but the SharePoint dataset format isn't clear.

Error Output (same for all attempts):

Connected as user@domain.com
[INFO]: [AddDataSource.Start] {
  apiId: 'shared_sharepointonline',
  hasConnectionId: true,
  hasConnectionRef: false,
  hasSolutionId: false,
  tableName: '{table-guid}',
  dataset: '{attempted-dataset-value}',
  region: 'Public',
  environmentName: '{environment-id}'
}
[INFO]: [AddDataSource.Path.Connector] {
  apiId: 'shared_sharepointonline',
  tableName: '{table-guid}',
  dataset: '{attempted-dataset-value}',
  sqlStoredProcedure: ''
}
[INFO]: [AddDataSource.ServiceCall.GetConnector.Start] { apiId: 'shared_sharepointonline' }

Error: Invalid URI format.

Invalid URI format.
Categories:
I have the same question (0)
  • Verified answer
    accordeonist Profile Picture
    28 on at

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard