How to get the current Environment URL in Canvas App or Custom Page?

 To get the Current Environment in canvas app,we can perform the following step:


Step 1: Include Canvas App data source in app and connector PowerAppForMakers as below screenshot.



Step 2: Set the below variable on load or particular event of the screen. 

the variable varCurrentEvironmentURL will store the environment url.

Set(currentAppURI, First('Canvas Apps').AppOpenUri);

Set(currentEvmtId, Right((Match(currentAppURI,"/e/.*(?=/a)").FullMatch),36));

ClearCollect(
    collAllEnvironments,
    AddColumns(
        Sort(
            PowerAppsforMakers.GetEnvironments().value,
            DataSourceInfo.DisplayName
        ),
        "DisplayName",
        properties.linkedEnvironmentMetadata.friendlyName,
        "Url",
        properties.linkedEnvironmentMetadata.instanceUrl
    )
);


Set(
    currentEnvironmentURL,
    First(
        Filter(
            collAllEnvironments,
            currentEvmtId in id
        )
    ).Url
);


What is Web-hook? How to configure the Web-hook?

Web-hooks is a lightweight HTTP pattern for connecting Web APIs and services with a publish/subscribe model.

Release with CE App 9.0


With Web-hook we can integrate Customer Engagement data with external service.

Web can be invoked from Plugin step or custom workflow activity. 

It can be invoked as Synchronous and Asynchronous.

To secure your endpoint and Authenticate:

  • HttpHeader
  • WebhookKey
  • HttpQueryString

Demo:
Step 1) To create the web hook HTTP endpoint, I have created Power Automate Flow with HTTP Request type trigger.



The HTTP trigger URL generated from this flow is as below:


https://prod-169.westus.logic.azure.com:443/workflows/97d8bb6abcfa4a87b75f0f39adeb32e9/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=1JlyOmHRx9OIRNXTsTT58RGLhITNMJdefruB0V5Q0rE


In this URL %2F means '/'. So, will need to replace it in the URL.
Values obtained from this URL is as below:

End Point UR: https://prod-169.westus.logic.azure.com:443/workflows/97d8bb6abcfa4a87b75f0f39adeb32e9/triggers/manual/paths/invoke

api-version=2016-06-01

sp=/triggers/manual/run

sv=1.0

sig=1JlyOmHRx9OIRNXTsTT58RGLhITNMJdefruB0V5Q0rE


Step 2) Configure the Web in Dynamics 365.
First we need to login into Plugin Registration Tool.

Click on Register -> Register new Web hook

Set the details of Web hook as we have extracted from Power Automate flow HTTP trigger URL.



Step 3) After Web hook is registered, we can registered the Step to trigger the web hook. 
I have configured the Plugin Step on Create message on my custom entity 'dnlb_webhook1'.




Step 4) Once the Plugin step is registered, perform the create operation on custom entity 'dnlb_webhook1'. On create, it will trigger the Power Automate Flow

Trigger event will create the details from entity 'dnlb_webhook1' passed to Power Automate Flow.




Good Luck 😎

How to read the file content when uploaded in file data type in Dynamics 365 field?

 Created new Entity File Upload. Created new field '* Upload' as file data type.


A flow is created which will trigger on Modified event on this entity record.

Design of flow is as below


Design of base64ToString is as below:


After the flow has run the output will be like below:



Featured Posts

Download CRM 365 V9.X Tools using PowerShell

This configuration explains about how to download D365 utility tools step by steps. Step1 : Create a folder in your particular drive where y...

Popular Posts

Contact Me

Name

Email *

Message *