[Bug] GetOrganizations is missing from the generated Dataverse service with Power Apps SDK 1.1.1 / CLI 1.0.1

Open
#462 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
tooling

Research direction

Start with the pa app add data-source generation path and the AddDataSource.InternalActionsFiltered diagnostic, then inspect src/generated/services/MicrosoftDataverseService.ts and the connector metadata containing GetOrganizations. Reproduce the missing method with the documented TypeScript call. Done means the generated service retains the operation, or a documented supported replacement and migration guidance are provided.

Written by the indexing model from the issue text.

Description

bug

Summary

After generating the Microsoft Dataverse connector with pa app add data-source,
MicrosoftDataverseService.GetOrganizations() is no longer available.

An existing code app's previously generated Dataverse service includes this
operation, and the app uses it to retrieve accessible Dataverse organizations
and their friendly names. Generating the connector for a new code app with the
versions below omits the method and causes the existing application code to
fail compilation.

The observed issue is in the generated connector service, not a missing
top-level export from the SDK.

Why this method is important

GetOrganizations is particularly useful for resolving details of the
currently selected environment using the Dataverse connector already connected
to the app.
It returns accessible organizations, allowing the app to identify
the selected environment and obtain its friendly name and organization URL.
It is a discovery operation; the application performs the selected-environment
matching.

This supports an important user experience: showing a recognizable environment
name instead of a GUID, so users can confirm which environment they are working
in. It also supports environment-aware pickers without hardcoding environment
names or introducing a separate connector just to retrieve this metadata.

Please preserve this capability, or provide a supported replacement before
removing access to the method.
Existing applications depend on it, and a
replacement should support retrieving the selected environment's details, not
only its identifier.

Environment

  • @microsoft/power-apps: 1.1.1
  • @microsoft/power-apps-cli: 1.0.1
  • @microsoft/power-apps-vite: 1.0.2
  • Node.js: 24.19.0
  • Operating system: Windows
  • Connector: shared_commondataserviceforapps
  • Exact CLI version that originally generated the working method: not recorded.

Steps to reproduce

  1. Create a React/TypeScript Power Apps code app with the versions above.

  2. Initialize it and add an existing Microsoft Dataverse connection:

    pa app init --display-name "Dataverse reproduction" --environment-id <environment-id>
    pa app add data-source --connector shared_commondataserviceforapps --connection-id <connection-id> --org-url https://<organization>.crm.dynamics.com
    
  3. Inspect src/generated/services/MicrosoftDataverseService.ts.

  4. Attempt to compile the following application code:

    import { MicrosoftDataverseService } from './generated/services/MicrosoftDataverseService';
    
    const result = await MicrosoftDataverseService.GetOrganizations();
    

Expected behavior

The generated service retains GetOrganizations, or the tooling provides a
documented, supported replacement and migration guidance for applications
already using this operation.

Actual behavior

The generated service does not contain GetOrganizations. TypeScript reports:

TS2339: Property 'GetOrganizations' does not exist on type 'typeof MicrosoftDataverseService'.

Relevant diagnostic evidence

The connector-generation log reports:

AddDataSource.InternalActionsFiltered
totalActions: 93
internalCount: 56
internalOperationIds includes: GetOrganizations

This suggests the operation is being excluded by the CLI's internal-action
filter. Please confirm whether this exclusion is intentional or a regression.
The diagnostic numbers above are from the connector metadata returned during
this reproduction.

Impact and current workaround

Existing applications that use GetOrganizations for environment discovery or
friendly environment names cannot compile against the newly generated service.

For the current environment's display name, our workaround is to read
getContext().app.environmentId, add the separate Power Apps for Makers
connector, and match that ID against the results of
PowerAppsforMakersService.Get_Environments().

getContext() supplies the environment ID and Dataverse organization URL, but
does not expose the friendly environment name. The workaround therefore adds
another connector solely for a lookup previously handled through Dataverse.
It is not necessarily a complete replacement for all GetOrganizations use
cases.

We have not manually modified generated files to restore the operation.

Requested guidance and future alternative

If GetOrganizations will remain unavailable in generated services, please
clarify:

  1. What is the recommended, supported alternative for retrieving the selected
    environment's friendly name and organization details in a Power Apps code app?
  2. Can this be done through the existing Dataverse connector or the Power Apps
    SDK context, without adding another connector? Could getContext() expose
    the environment's friendly display name alongside environmentId and
    dataverseOrgUrl?
  3. Is Power Apps for Makers Get_Environments() the recommended long-term
    replacement, and what differences in permissions, licensing, or DLP
    requirements should applications account for?
  4. Please provide a working code sample, the minimum supported SDK/CLI versions,
    and migration guidance so applications can continue to resolve the selected
    environment if this method is not available in future releases.
Dominant language
TypeScript
Stars
504
Forks
145
Avg merge
4h 3m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/PowerAppsCodeApps

All issues in microsoft/PowerAppsCodeApps

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.