In this guide, you will learn how to connect Dataverse as a data source in Power Apps Code Apps and use it in your application.

Prerequisites

Before you start, make sure you have:

Stepwise implementation

1 - Prepare your Dataverse table

Screenshot 2026-05-26 141459

2 - Add Dataverse as Data Source

Inside your Code App project, run this command in terminal

pac code add-data-source -a dataverse -t cr399_pacademo

How to get logical name of table?

Screenshot - 2026-05-26T141904.781

3 - What happens after you add Dataverse

Once added, Code Apps automatically generate:

Screenshot 2026-05-26 142148Screenshot 2026-05-26 142159

Conclusion

Here, we have learnt how to add Dataverse as Datasource to Power Apps Code App using add- data-source command.