October 29, 2021

New DRB version, Web API and Postman

Two days ago I released Dataverse REST Builder (link) and I received many feedbacks about it, developers inside the Power Platform community found this new tool useful (and as I wrote before it would not exist without CRM REST Builder).

DRB generates Xrm.WebApi and jQuery/XHR code, the goal in my mind is to assist when writing JavaScript code, probably targeting a Model-Driven app. However I am well aware that not everybody works as I do and maybe they will use the tool in a different way.

When I was developing the tool I often checked the official Microsoft documentation regarding Web API (link) to understand some specific options and how the endpoint works but one section I noticed is Use Postman with the Web API. Postman is a tool I personally use but not too much for Dataverse, if I can use C# I prefer the official SDK and for JavaScript Xrm.WebApi is usually enough.

However Postman was a big inspiration, the idea to load/save a collection (and the possibility to create folders and requests at any level) is from there, I can't deny it.

After the first release I checked if it was possible to export a collection created in DRB to Postman, my json data structure holds more data but in a different format, however the generation code for jQuery/XHR is very similar to a Web API call: the url is exactly the same, differences are on how the headers are stored and how the body (for POST and PATCH requests) is written.

After some changes in my code I released the 1.0.0.1 version:

Beside the new "Export as Postman Collection (2.1)" functionality I also fixed a bug inside the "Create" and "Update" requestes for jQuery/XHR code generation.

The Postman collection is structured in a different way from the Microsoft tutorial, there are 4 variables and they are connected to the collection and not to an environment, the Authorization type is OAuth 2.0 and you need to generate a valid token after you imported the collection.

If you use a different authentication method and you think DRB can be expanded to include some settings during the export, open an issue and I will be happy to discuss there, I can't make promises (as this "Export as Postman Collection" is a totally separate functionality) but I am always interested on how people use the application.

The code is separated but some existing functions are still called during this export (for example the $filter clause for Retrieve Multiple is the same) so if something is not working inside Postman will be useful to know if the same problem happens inside Xrm.WebApi/jQuery/XHR or not.



October 27, 2021

New tool: Dataverse REST Builder

Note: new version has been released, read more here or download from GitHub

If you created Web API queries against CRM/Dynamics 365/Dataverse probably you are familiar with CRM REST Builder. The amazing tool created by Jason Lattimer helped me countless times in the past years and is a tool I still use today.

The ability to generate queries (especially with Xrm.WebApi when it was introduced) comes very handy, and CRM REST Builder has several functionalities but the one most used is probably the Retrieve Multiple one.

In the past years the development of CRM REST Builder has stopped and beside some bugs the other important missing thing is the compatibility with Unified Interface.

I decided to create a new tool to replace CRM REST Builder, and Dataverse REST Builder (DRB) is finally public at this repository:

https://github.com/GuidoPreite/DRB

 It comes with a Managed Solution to install inside your instance and it will popup inside the Apps list:

As I like to test my code offline, there is also a demo mode, so you can test the application before installing the solution: https://guidopreite.github.io/DRB/

The demo data is not complete but enough to understand how the application works and the demo table  called "Custom Table" contains the majority of columns available inside a Dataverse instance.

Main differences between CRM REST Builder and Dataverse REST Builder are:

  • DRB does not support the 2011 Endpoint (so if you still need it you can continue to use CRM REST Builder)
  • DRB allows to create, save and load a collection of requests, useful if you need to store somewhere the Web API queries you created
  • Support for new columns like "Choices" (also known as Multi Select Option Sets) and better support for "Image" and "File" columns
  • Ability to create requests to execute Custom API
  • A specific request to execute a classic Workflow
  • For Retrieve Single, Create, Update, Delete, it generates also the code for Xrm.WebApi.online.execute

DRB is not perfect and probably there are some bugs as well, but the main functionalities are available and I prefer to release it and gather some feedback.

Some may ask why I decided to create a new tool and not update the existing one. Is a valid concern and I thought about it too, in the end I decided to start from scratch. Main reason is that I had already a solid base to deal with dropdowns (as in my previous tool DOSM) and I designed the application with a different approach, the fact that you can save a collection of requests divides the tool in 3 main parts: a json data structure to hold the request, a UI to manipulate the json data structure and a code generation part accepting the json data structure to create the code.

As developers we need this tool? Honestly not too much, CRM REST Builder is still a great and working tool, and Dataverse REST Builder would not exist without it, I just felt that sometimes we need to deal with new column types or new requests and it's nice to have now a tool.

Hope you find Dataverse REST Builder useful and if something is not working you can open an issue inside the GitHub repo!