3

Is it possible to create some kind of script (SQL, PowerQuery or whatever) to create tables (and other DB Stuff) in Dataverse? Everywhere I look they only describe how to click click click, I'd like to have a workflow of creating stuff on my own environment and then deploying it somehow on a client (a normal workflow).

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Rudonja
  • 47
  • 8

3 Answers3

1

To deploy your work into other environments you should use a Solution.

This allows you to package up the configuration and code within a single file for deployment into other instances.

https://learn.microsoft.com/en-us/powerapps/maker/data-platform/solutions-overview

Brent
  • 106
  • 2
  • I guess you could potentially script the tables by editing a solution file directly, but the format is not straightforward. At the time of writing it looks like click click click is still the best option – Andy Jul 08 '23 at 09:01
1

Each Table is nothing but an Entity in your Dataverse , so Create a new Entity in your dataverse through code:

  1. You need to create an OrganizationServiceContext that implements the IOrganizationService Interface to track and make changes to the Entities in your Dataverse Environment.
  2. Then you need to Create an EntityMetaData class Instance with your Entity Details and pass this to CreateEntityRequest which again has to be passed to the Execute Method of the OrganizationServiceContext. 3)https://learn.microsoft.com/en-us/powerapps/developer/data-platform/org-service/create-custom-entity This might help you
0

I guess this should be able by using the Web API

https://learn.microsoft.com/en-us/powerapps/developer/data-platform/webapi/create-entity-web-api