Practice Lab 4 - Power Platform tools

Scenario

As we continue to build our solution, we will now install and configure tools used for extending the Power Platform with code.

Prerequisites

The following software must have been installed:

  • .Net Framework
  • Visual Studio Community Edition 2022 v17.10.5 or higher
  • Visual Studio Code
  • Power Platform CLI

High-level lab steps

We will install and configure the following tools:

  • Configuration Migration Tool
  • XrmToolBox

Things to consider before you begin

  • Which tools do you require?
  • Which IDE(s) do you require?

Starter solution

A starter solution file for this lab can be found in the C:\Labfiles\L04\Starter folder.

Exercise 1: Configuration Migration Tool

Objective: In this exercise, you will copy reference data between environments.

Task 1.1: Export data from Development

  1. Open a Command Prompt.
  2. Launch the Configuration Migration Tool with the following command.

    pac tool cmt
    

    Configuration Migration Tool - screenshot

  3. Select Create schema and select Continue.
  4. Select Office 365 for Deployment Type.
  5. Check Display list of available organizations.
  6. Check Show Advanced.
  7. Enter your tenant credentials.

    Tools login - screenshot

  8. Select Login.

    Tools environments - screenshot

  9. Select your Development environment and select Login.
  10. Select the Permit Management solution.
  11. Select the Build Site table under Select Entity.
  12. Select Build Site, City, Country/Region, State/Province, Street Address, ZIP/Postal Code columns.
  13. Select Add Fields >.

    Configuration Migration Tool table and columns- screenshot

  14. Select the Permit Type table under Select Entity.
  15. Select Name, Permit Type, Require Inspections, Require Size columns.
  16. Select Add Fields >.
  17. Select Save and Export.
  18. Enter permit.xml and select Save.
  19. Select Yes to export the data.
  20. Select the ellipses next to Save to data file.
  21. Enter permitdata.zip.
  22. Select Save.

    Configuration Migration Tool export - screenshot

  23. Select Export Data.
  24. Select Exit.

Task 1.2: Import data to Production

  1. Open the Command Prompt.
  2. Run the command pac tool cmt.
  3. Select Import data
  4. Select Continue.
  5. Select Office 365 for Deployment Type.
  6. Check Display list of available organizations.
  7. Check Show Advanced.
  8. Enter your tenant credentials.
  9. Select Login.
  10. Select your Production environment and click Login.
  11. Select the ellipses next to Zip File.
  12. Select the permitdata.zip file you created in the previous task and click Open.
  13. Select Import data
  14. Select Exit.
  15. Close the Configuration Migration Tool window.

Exercise 2: Community tools

Objective: In this exercise, you will use FetchXmlBuilder in the XrmToolBox to find inspections with status reason New request or Pending.

Task 2.1: Install XrmToolBox

  1. Navigate to XrmToolBox https://www.xrmtoolbox.com

    XrmToolBox website - screenshot

  2. Download the latest version of XrmToolBox.
  3. Right click on the XrmToolBox.zip file and select Properties.
  4. Select Unblock and Apply.
  5. Extract the XrmToolBox.zip file to a folder.
  6. Run XrmToolBox.exe from the folder.

    XrmToolBox app - screenshot

  7. Select Open Tool Library.
  8. Search for fetchxml and select FetchXML Builder by Jonas Rapp.

    XrmToolBox Tool Library - screenshot

  9. Select Install.
  10. Select Close.
  11. Search for trace and select Plugin Trace Viewer by Jonas Rapp.
  12. Select Install.
  13. Select Close.
  14. Close the Tool Library tab.

Task 2.2: FetchXML query

  1. Select the Tools tab in XRMToolBox.
  2. Search for fetchxml and select FetchXML Builder.
  3. Select Yes to Do you want to connect to an organization first?.
  4. Select Open Connection Manager.
  5. Select New connection.
  6. Select Microsoft Login Control.
  7. Click Open Microsoft Login Control.
  8. Select Office 365 for Deployment Type.
  9. Check Display list of available organizations.
  10. Check Show Advanced.
  11. Enter your tenant credentials.
  12. Click Login.
  13. Select your Development environment and select Login.
  14. Enter Dev for Name and select Finish.
  15. Select Close.
  16. Select the Dev connection.
  17. Select OK.
  18. Select Continue.

    FetchXML Builder - screenshot

  19. Click on the (entity) node in the Query Builder pane.
  20. Select contoso_inspection in the Entity name drop down.
  21. Click on filter under Quick Actions.
  22. Select statuscode in the Attribute drop down.
  23. Select Equal in the Operator drop down.
  24. Select New Request in the Value drop down.
  25. Click on +condition under Quick Actions.
  26. Select statuscode in the Attribute drop down.
  27. Select Equal in the Operator drop down.
  28. Select Pending in the Value drop down.
  29. Click on the filter node.
  30. Select or in the Filter type drop down.

    FetchXML Builder query - screenshot

  31. Select View and then select FetchXML. The FetchXML should look like the following query.

    <fetch top="50">
      <entity name="contoso_inspection">
        <filter type="or">
          <condition attribute="statuscode" operator="eq" value="1" />
          <condition attribute="statuscode" operator="eq" value="330650001" />
        </filter>
      </entity>
    </fetch>
    
  32. Select Execute (F5). You should see a list of inspection records.

  33. Select Convert and then select Power Automate Parameters. The filter should look like the following

    (statuscode eq 1 or statuscode eq 330650001)