# How do I call a Dataverse action or function from a Power Apps code app?

Exam: AB-400 — Power Platform Developer Associate
Knowledge domain: Extend the user experience (25–30%)
Updated: 2026-11-25T06:47:19.355271+00:00
HTML: https://learningpathx.com/faq/AB-400/ab400-power-apps-code-app-dataverse-action-function.html

## Also asked as

- How do I discover a Dataverse operation and generate its service in a code app?
- How do I add WhoAmI or a bound Dataverse action to a Power Apps code app?

Use Power Apps CLI to discover the Dataverse operation in the configured environment and generate its TypeScript service. With an initialized code app and `@microsoft/power-apps` version 1.1.1 or later, you can start with the unbound `WhoAmI` function:

```shell
pa app find-dataverse-api --search "WhoAmI"
pa app add dataverse-api --api-name WhoAmI
```

Import the generated `WhoAmIService` and call `WhoAmIService.WhoAmI()`. Check the generated response and verify that it identifies the intended development user and organization. For a bound action such as `AddToQueue`, inspect the bind target, required parameters and return type. The generated signature for that action takes the binding row ID first.

When an operation definition changes, add the same operation again to update the generated contract. Review the diff and retest callers with the intended user. Verify a business action's actual outcome and permission checks independently of the identity returned by `WhoAmI`.

[Add a Dataverse action or function to a code app](https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/add-dataverse-action-function)

Source: [AB-400: Building Code Apps with Dataverse and Automation](https://learningpathx.com/news/ab-400-building-code-apps-with-dataverse-and-automation.html)
