How to connect Power Apps Cards to Dataverse and Debug them

Sending
User Review
0 (0 votes)

In our last blog related to Power App cards, we learned how to create and design a power app card and designing of it.

In this blog we will learn about Connecting the card to Microsoft Dataverse, storing the values in the Dataverse table, and debugging the card.

Follow the below steps to connect the cards to Microsoft Dataverse so that values can be stored in the respective table.

Step 1. Click on the Data icon and select Add data as shown below.

Power App Cards

Step 2. Select Microsoft Dataverse and select your table as shown below.

Power App Cards

Step 3. Select the table and click on the Select button.

Power App Cards

Step 4: Add a screen to the card by clicking on the New Screen option as shown below.

Power App Cards

Give a name to it.

Power App Cards

Step 5: On the next screen add label text and input field.

Power App Cards

Step 6: We give a title and assign a variable name recordId which we are using to store the id of the record that is being created after clicking on submit button to populate the ID.

Power App Cards

Step 7: Add a formula on Submit button to store the values in CRM.

Power App Cards

Formula:

Set(recordId,Collect(new_registration,{Name:txt_Name, new _employeeid:txt_Id,
new _department:txt_Department, new _phone:Value(txt_Phone), new _emailid:txt_Email,
new _bringingfamilymembers:Text(choiceSet), new _eventdate:Text(EventDate),
new _eventtime: Text(EventTime)}).Registration);

Navigate(Success);

Here, we have used the Collect formula to store the values in Dynamics CRM.

Collect ( Entity logical name, { Column name: Name of the field in card } )

To get the record id that has been created by the collect functionality we add the collect formula inside the Set function.

Set (variable name, Collect());

To Navigate to another page, we have used Navigate function.

Navigate(screen name)

Step 8: To run your card please click on the Play button as shown in the below image.

Power App Cards

After running the card, fill in the details, and once you click on submit button the entered data will get stored in Microsoft Dataverse.

But to check whether the values are getting assigned properly or not or to check the errors, we can debug the card. Debugging is achievable from debug panel that Microsoft has provided in cards.

Follow the below steps to debug the card – 

1. Click on the Play button first to run your app as shown in the above image.

Power App Cards
2. Enter the values in respective fields and click on Submit button.

Power App Cards
3. After clicking on submit button, the user will get navigated to the next screen where the user can check the record id.

Power App Cards
4. Click on Debug panel to open the debugging session as shown in the below image.

Power App Cards
5. After you click on Debug panel, you will be able to see the below window.

Power App Cards

Memory:- This tab shows, the variables and values assigned to it.

For eg., We passed Smith as a value for the name and in the debugging window I can see that Smith has been assigned to the txt_Name field.

Power App Cards

JSON:- JSON tab represents the JSON representation of the card.

Power App Cards

Info:- The Info tab displays the card’s Environment ID, Card ID, and User.

Power App Cards

Conclusion

It is very easy to connect Power App Cards to Dataverse and we can check the stored values while debugging these cards.

Microsoft Power Platform (3)

The post How to connect Power Apps Cards to Dataverse and Debug them first appeared on Microsoft Dynamics 365 CRM Tips and Tricks.