Uncategorized
Call custom action using WebApi in PowerApps portals/ dynamics 365 portals.
Category: Uncategorized Author: debajit prod Date: 3 weeks ago Comments: 0

So here I am in the last blog of this series in which I covered the various web api operations we can perform from PowerApps portals. If you are new to the concept of WebAPI in PowerApps portals, I strongly suggest you read this series from the beginning. However if you are looking for specifically on how to call an action using WebApi from portals, continue reading.

For this example, I am using a custom action bound to contact entity. Below is the snapshot of the action.

Bound Action

As seen from the above screenshot, we have two input parameters and one output parameters. The action is bound to contact entity. To call the action, we actually need to perform the same operation we performed in our previous blog. To call a bound action, you should configure the same site settings you configure while calling a WebApi for create/ update/ delete operation.

Setting 1

The first setting is to enable webapi support for an entity in the portal. To do that, create the below site setting. If the site setting is already present, we don’t need to create it.

Setting 2

This setting is to enable fields which will be used by WebApi. This is probably the most important step and missed by developers while configuring a custom action from WebApi.

Observe the highlighted field – “StringParam”. This is the same parameter which is used in the action as input parameter. Although it is not a field of contact entity, but any action called on the contact entity should register the input parameter in the field list.

If you are not including the parameter in the request, the parameter can be skipped in the list of fields.

All set and done, it’s now time to clear the portal cache and browse the portal. Below is the sample code to invoke the action.

shell.getTokenDeferred().done(function (s) {
  
   var inputJson = {};
   inputJson.StringParam = "Invoking custom action from Portal";

   var inputstring = JSON.stringify(inputJson);

   var url = "<your_portal_url>/_api/contacts(1715cd14-24de-ea11-a814-000d3a0a7552)/Microsoft.Dynamics.CRM.new_WebApiAction";
   var xmlHttp = new XMLHttpRequest();
   xmlHttp.open("POST", url
      , true);
   xmlHttp.setRequestHeader('Content-Type', 'application/json');
   xmlHttp.setRequestHeader('__RequestVerificationToken', s);

   xmlHttp.onreadystatechange = function () {
      if (this.readyState === 4) {
         if (this.status === 200) {
            // your custom code goes here;
         }
         else {
            //you custom code goes here;
         }
      }
   };

   xmlHttp.send(inputstring);

});

Observe that I didn’t include the Entity reference input parameter in the action. If I include that, I need to include that in my field list as well.

And before I end, don’t forget the entity permission on the contact entity. Even though the action is not retrieving the contact entity information through the action, to call an action bound to contact entity, you must have entity permissions enabled for the entity. The same applies to any other entity as well.

Hope that helps!
Debajit Dutta
(Business Solutions MVP)

Source: Debajit


Hello world!
Category: Uncategorized Author: debajit prod Date: 1 month ago Comments: 0

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Source: Debajit


Dynamics 365 Customer Insights Technical Deep Dive Part 3 – Segments and ‘Segment’ Insights
Category: AI,Azure,customer insights,Customer Segments,Dynamics 365,Dynamics 365 Customer Insights,Dynamics Marketing,Marketing Segments,Power Paltform,segment insights,Uncategorized Author: Manonmani V S Date: 3 months ago Comments: 0

You have your customer data and I am gonna show you how to create rich Customer Segments and get an AI-driven Insight on your Segments. By segmenting your huge customer data, you can now take targeted action on your customers. Take right Action on right Customer at right Time By Microsoft Segments enable you to […]
Source: Mano


Power Virtual Agent | Configure Fallback
Category: AI,Chat Bot,Power Automate,Power Platform,Power virtual Agent,Uncategorized Author: Manonmani V S Date: 3 months ago Comments: 0

Yay! With “Fallback” option now, your Bot can give up if it doesn’t undestand the user utterance. Take a look at the screenshot below: (Without Fallback option) The Bot doesn’t understand the user utterance “Shibasakura”, and it asks the same question twice to the customer before escalating it. While it’s fine for the bot to […]
Source: Mano


Dynamics 365 Customer Insights Technical Deep Dive Part 2 – Configure Custom AI Models to add Intelligence
Category: AI,Artificial Intelligence,Custom AI Model,customer 360,Customer Data Platform,Customer Segments,Customer Service,Dynamics 365,Dynamics 365 CE,Dynamics 365 CI,Dynamics 365 Customer Insights,Uncategorized,unified customer profile Author: Manonmani V S Date: 4 months ago Comments: 0

How I wish we have prediction models in Dinosaur era – would have saved the species! Yes, our customers might be churning out. There might be various factors contributing the to churn risk of our customer. How do we predict churn and retain our customers? AI is a game changer With Microsoft Dynamics 365 Customer […]
Source: Mano


PowerApps Component Framework – Quick Assign Record Control
Category: Uncategorized Author: Ramprasath Date: 11 months ago Comments: 0

Its #FriYay! For every click saved in your work is a productive second put into good use! From what I have seen, users expect to complete a certain operation in and around 2 clicks. For instance, consider assigning a record in CRM to another user/team – this would pretty much take 4 clicks. How can we … Continue reading PowerApps Component Framework – Quick Assign Record Control
Source: Ram


PowerApps Component Framework – Animated Progress Control
Category: Uncategorized Author: Ramprasath Date: 11 months ago Comments: 0

How can we gamify the progress bar to make it a usable feature? How about an animated circular progress powered by bootstrap which shows percentage of completion of a certain task. How cool is that? Scenario: An intuitive way to show the progress of courses taken by a student and how close he/she is to … Continue reading PowerApps Component Framework – Animated Progress Control
Source: Ram


1 2 3