Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip

Both the CDS and CDS Current Environment connector are similar yet different in the way how they accept Lookup values set in their Update a record steps.

Here’s a quick tip!!

Scenario

Taking a simple example of setting Primary Contact Lookup on Account.

We’ll do the same thing using both the connectors mentioned below.

Common Data Service connector

Common Data Service (Current Environment) connector

Common Data Service Connector

Let’s start with using the classic Connector first –

  1. As mentioned in the Scenario above, let’s first try to use a class Common Data Service connector. Here’s how you identify the same.

  2. Now, whenever you have to set the Lookup value in the classic connector’s Update a record action, you can simply tag the Primary Key as is on the field in the connector step as shown below.


    And lookup can be tagged very easily.

Common Data Service (Current Environment) Connector

  1. Let’s do it with the new Common Data Service (Current Environment) connector. This is a much simpler way to tag a Lookup. Now, the new CDS Current Environment connector can be identified as below.

  2. In order to set Lookup, you’ll need to patch is in the below way
    pluralNameOfTheEntity([PrimaryKey])

  3. Here’s how my friend Linn Zaw Winn’s post explains in details of why we have to choose the plural name and exactly where you can get it from – http://linnzawwin.blogspot.com/2019/11/power-automate-how-to-set-lookup-field.html

Hope this was useful. Here are some more Power Automate / CDS posts which you might want to check out –

  1. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  2. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  3. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  4. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  5. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  6. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  7. Accept HTTP Requests in a Flow and send Response back | Power Automate
  8. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  9. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  10. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform

Thank you!!

Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate

I faced this issue lately and not sure if it’s a bug or something I might be missing. But, I couldn’t find anything in Dynamic Content in a Flow and I was not able to pick fields to use further in a Flow.

Not sure how many of you faced this since most fields you need are available in a Flow’s Dynamic Content part.

Scenario – Adaptive Cards for Teams issue

I had this one scenario in particular where the Adaptive Card I created for Microsoft Teams’ User sends back Response but the Dynamic Content doesn’t appear in the steps after the Card Step.

  1. See below that I’ve declared a Variable just to show that the Dynamic Content that should appear after the Adaptive Card.

  2. And if I press the Dynamic Content as shown above in Step #1, and minimize all the content, I don’t see the Teams’ Dynamic Content variables at all

  3. And the Adaptive Card didn’t return the below Outputs



    That’s when we should use outputs() function to read this data.

outputs() function

Here’s how you can use the Parse JSON action and outputs() method to read the Outputs of the step you want and then Parse JSON so that these can be picked as variables/dynamic values in steps following this –

  1. Take Parse JSON action from Data Operations in a Flow

  2. In that in Inputs, you can use Function on the Content field.

  3. And write outputs function as shown below –

    And the complete the function as below

    Explanation:
    MyCard is the name of the step of my AdaptiveCard I used. If the name of you step has spaces like “My User Adaptive Card”, then the function will look like outputs(‘My_User_Adaptive_Card’)[‘body’]

    body is written because if you see in the Outputs originally in the Scenario section above, all results are sent in body field of Outputs.

  4. Now, since you don’t know the Schema, just put a “{}” so that you can Save the step. (This is required)

  5. Run the Flow once and collect the Outputs from this ‘Parse JSON 2’ step as shown above.
    Copy the Outputs

  6. Now, open the same Parse JSON 2 step which you created. And click on Generate from sample

  7. And paste the schema in the box.

  8. Once done, schema will be generated like this.

  9. Now, this Parsed Outputs can be further used which will have the data from the Step which didn’t yield Dynamic Content
    Example, I’ll create a variable to show Dynamic Content that can pop-up

  10. It’ll show all the fields from the Card in the Parse JSON 2 outputs


    And that solves the problem!!

    Original Microsoft Documentation on the same is: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#outputs?WT.mc_id=DX-MVP-5003911

Hope this was helpful.

Here are some more Power Automate / Adaptive Card content you might want to look at –

  1. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  2. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  3. Save Adaptive Cards work using VS Code Extension – Adaptive Cards Studio | Quick Tip
  4. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  5. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  6. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  7. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  8. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  9. Terminate a Flow with Failed/Cancelled status | Power Automate
  10. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!!

Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform

Let’s take a look at how you can design Adaptive Cards for Outlook and get response from Outlook users to process using Power Automate.

Scenario

Let’s say I wanted to send an Adaptive Card to an Outlook user on their Email and ask some comment, example – A descriptive feedback and read their response back and send them a confirmation Adaptive Card.

In this post, I’ll simply read the Response in the Flow and send a Confirmation-like Adaptive Card so that you can then further decide to take required action for it based on your use case.

Adaptive Cards Designer – Initial Card Layout

You can logon to https://adaptivecards.io/designer/ i.e. the Adaptive Card designer and start building your card. Below are the high-level steps:

  1. Once you are in the Adaptive Cards Designer, make sure you select the host app as “Outlook Actionable Messages

    You’ll see a sample already created for you which you can start working off of –

  2. Since I want to start from the beginning, I’ll select New Card option as shown below

  3. Now, I’ll start to design my card with the use of some TextBlock, an Input.Text to capture a response. In your case, you can choose the type of input(s) you want. (I’m trying to keep it simple for now 😊)
    These controls works like a drag-and-drop behavior, just drop whatever you need.


    So, I did the following, I added a TextBlock to add the title I want to show on the card and a Multi-line Input.Text to capture a response of the user I’ll send the card to in their Email.

  4. For the Input.Text, I’ve added an id ‘answer‘. We’ll need this when we capture responses back.
    Also, to make the Input.Text control as multi-line, Multi-Line option should be selected as I did below

  5. At this point, our Adaptive Card’s layout is ready. Before we proceed we must first, create a Flow that will capture an HTTP Response and then we’ll come back here.

Flow to Capture Response

Adaptive Cards for Outlook Actionable Messages work off of the HTTP mechanism and that’s why you need a URL where you can capture the responses and send back a confirmation response back.

Let’s call this Flow as “Accept Feedback Response

  1. To do so, first create a Flow that Accepts an HTTP Request. You can refer my other post in order to understand how you can capture HTTP Responses – Accept HTTP Requests in a Flow and send Response back | Power Automate
    Once once you save a Flow that has a trigger of HTTP Response, you’ll get a URL generated, copy it.

  2. Next, I’ll enter the schema by clicking on Use sample payload to generate schema button on the first step above and enter the following schema since I know that’s what is to be expected from the User when they fill in the Text and submit back.

  3. Once you click OK, your schema will look like this.

  4. Collect the result of the above trigger in the Compose so that you can save the Flow with at least 1 Action. (We’ll come back to it later)

  5. Next up, we will also need to setup a response Adaptive Card. This is something that the users will see when they Submit their responses.

  6. It is mandatory to send the response back to the caller i.e. the Outlook in this case. Hence, we’ll send a Response back using Response action in HTTP and send the status code as 200 and header CARD-UPDATE-IN-BODY as true.
    The Body will have the Adaptive Card which we created in step #5 above i.e. the Adaptive Card we have to send as confirmation.

    Here are the details of Refreshing Cards when you send back a response to the client (Outlook user in this case): https://docs.microsoft.com/en-us/outlook/actionable-messages/adaptive-card#refresh-cards?WT.mc_id=DX-MVP-5003911

Complete your Adaptive Card – Add Action

Once your Flow to capture the response is ready, let’s complete the Adaptive Card to add an Action to the same.

  1. Select the card body, you’ll see a button to Add an action

    You’ll need to select Action.Http

  2. Once you select the Action.Http type of Action, look at the Element Properties, you’ll need to enter the URL we got from the Flow we created to capture responses above.

    Here why we chose Action.Http – https://docs.microsoft.com/en-us/outlook/actionable-messages/adaptive-card#outlook-specific-adaptive-card-properties-and-features?WT.mc_id=DX-MVP-5003911
  3. Next, set the title of the Action (it appears as a button). I’ll name it Submit.
    Also, select what kind of Method is to be used for the HTTP Request.

  4. Now, since you’ve selected POST method, you will need to pass the Body. This will be the response which the user will send and which the Flow above will read it as a Response to process the information further.
    Once you select POST, a Body element property will be added where you need to enter the schema and what ID of the element that information belongs to

  5. Remember, the ID for the Input.Text was set as “answer”, we’ll put that here and then it’s Value property. These values should be enclosed in double curly brackets {{ }}.


  6. And also, you’ll need to pass along the Header for Authorization. Read this post by Microsoft – https://docs.microsoft.com/en-us/outlook/actionable-messages/security-requirements#action-authorization-header?WT.mc_id=DX-MVP-5003911
    Add Header as shown below

    Now, as mentioned in the above post, we need to pass the property as Authorization header and leave it blank and Content-Type as application/json

  7. Once all this is done, it’ll look like below in the card payload for the Action.Http part.

  8. Now copy the entire Payload from the Editor and we’ll create a new Flow that will be used to send the Adaptive Card to the user.

Flow to Send the Adaptive Card in Email

I’m creating a Flow here which will be used to send the Adaptive Card. To keep it simple, I’m just triggering it using a button on-demand. Your use-case will vary.

Let’s call this Flow as “Send Feedback Request

  1. Wherever you need to create the Adaptive Card, you’ll need to paste the entire Payload copied from the step above in a Compose step

  2. I’ll add a step to send an Email directly using Send Email and make sure you enable the </> part for the body.


    Make sure the Outputs of the Compose we pasted above in Step #2 are enclosed in
    <script type="application/adaptivecard+json">
    </script>

Working

Let’s look at how this will turn out!!

  1. Let me just Run the Flow as is so that the Adaptive Card is generated and sent to the user I intend to in the Email.
  2. They’ll receive an email like this

  3. And the user will submit the answer in the text box and submit.

  4. Once they submit, the Accept Feedback Response Flow we created will be triggered

  5. And the response is available to be read and processed further in the Compose step we created to collect it with the defined schema.


  6. The Adaptive Card we had created to send back as confirmation (which looks as below) will be sent

  7. Once the user submits, they’ll get the below Adaptive Card as a confirmation that their feedback has been taken.

And that’s how you can make your Adaptive Cards to function with Outlook!! Hope this was helpful.

Here are some superb posts on Adaptive Cards –

  1. Microsoft Message Cards – The Ultimate Guide by Thomas Poszytek – https://poszytek.eu/en/microsoft-en/microsoft-message-cards-the-ultimate-guide/
  2. Multi line Approvals with Adaptive Cards, Outlook and Power Automate by Yash Agarwal – https://www.bythedevs.com/post/multi-line-approvals-with-adaptive-cards-outlook-and-power-automate
  3. Custom Actionable Messages with Microsoft Flow series by Rik-de Koning (3 posts) – https://www.about365.nl/category/blog-series/custom-actionable-messages-with-microsoft-flow/

Here are some more Power Automate / Adaptive Cards posts you might want to look at –

  1. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  2. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  3. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  4. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  5. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  6. Terminate a Flow with Failed/Cancelled status | Power Automate
  7. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  8. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  9. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  10. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  11. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  12. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!! 😊

Make On-Demand Flow to show up in Dynamics 365 | Power Automate

Here’s a Flow trigger that you can make to appear on-demand in Dynamics 365 views. What makes a Flow appear on a certain entity?

Like this –

Common Data Service connector (Not Current Environment version)

If you’re familiar by now with Common Data Service Connectors, there are 2 of them. 1. Common Data Service, 2. Common Data Service (Current Environment).

  1. Here, you’ll have to use the 1st one i.e. Common Data Service connector. If you type Common Data Service in triggers, both will appear but you have to hover on these and make sure you don’t select the one with Current Environment written on it.

  2. Once you select this, you can select this trigger in order to make it on demand in Dynamics 365.

  3. Now, it appears like any other Flow trigger. Optionally, you can add some inputs in case you want to.
    In my example, I’m taking in a field value called as “Common Comments” and will just update the Description field of the selected Accounts for simplicity of this example.

    Because I want it on Accounts entity views, I’ll select entity Account.


  4. Now, my Flow looks like this. That’s it.


  5. To keep things simple, I’ll just update the record with whatever I put in the Common Comments Input variable in my Flow trigger.

    Now let’s see it work.

On-Demand Flow

Now, in Dynamics 365, I’ll navigate to Accounts entity and select a few records.

  1. Once I select a few records and check the Flows dropdown from the ribbon menu –



  2. If I run this flow, I’ll get option to put my Input parameters as I have declared above.

  3. Since I had selected 2 records, there’ll be two separate instances (Flow Runs) triggered for this Flow

  4. And I can see the values updated in the records. (Checking using Advanced Find)

    That’s it!!

Hope this was useful.

Here are some more Power Automate / Flow posts you might want to look at-

  1. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  2. Secure Input/Output in Power Automate Run History
  3. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  4. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  5. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  6. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  7. Accept HTTP Requests in a Flow and send Response back | Power Automate
  8. Terminate a Flow with Failed/Cancelled status | Power Automate
  9. Pause a Flow using Delay and Delay Until | Power Automate
  10. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate

Thank you!!

Run As context in CDS (Current Environment) Flow Trigger | Power Automate

In a CDS (Current Environment), you have to option to Run the Flow under a context of a certain user. And there are a few options from which you can select from – Process Owner, Record Owner & Triggering User

Here’s my Flow in which the trigger is the CDS (Current Environment) connector. Show advanced options and you’ll see that there’s a field call as Run As


Which has the following 3 Options as I mentioned above –

Let’s look at each one of these.

Scenario

To demonstrate Run As, my Flow is triggering on the Update of the Account record, an attribute in the CDS (Current Environment) connector called as RunAsSystemUserId provides the GUID of the System User used in the connector’s Run As field.

You can use triggerOutputs() function to get this GUID from the Trigger Outputs and use it to fetch the System User record. To see how triggerOutputs/triggerBody() works, check this post – Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Process Owner

As suggested, Flow Owner meaning the one who Owns the Flow

  1. If I select as Process Owner, no matter who triggers the Flow or who is the Owner of the record, the Run As user will be the one who Owns the Flow.


    The record could belong to one owner and the other owner might modify it as shown below –



    But the Flow will Run As the Owner of the Flow as suggested.




    Multiple Owners?
    In my test, I believe the one who created the Flow becomes the first Owner and hence, is what it appears in Run As

Record Owner

  1. Easily, the record Owner in Dynamics 365 is the Owner of the record, so no matter who triggered the Flow or who the Flow owner is, the Record Owner will be the Run As user.

  2. In this example, Priyesh Wagh is modifying the record Owner by Kuldeep Gupta, the Flow Run As will show as Kuldeep Gupta

Triggering User [Also Default]

  1. If the Run As is set to Triggering User, whoever caused the Flow to Run is the Run As context user.


    Let’s say Kuldeep Gupta is a user is modifying a record Owned by SYSTEM, the Run As user is Kuldeep Gupta.




  2. Now, if there’s no Run As selected or even if there are multiple Owners to the same Flow, the one who causes the Flow to run, is the context user of the Flow.


    Let’s say Priyesh Wagh modified this record owned by SYSTEM, the Flow will Run As Priyesh Wagh


Hope this helps!!

Here are some more Power Automate related posts you might want to look at –

  1. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  2. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  3. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  4. Accept HTTP Requests in a Flow and send Response back | Power Automate
  5. Terminate a Flow with Failed/Cancelled status | Power Automate
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  11. Text Functions in a Flow | Power Automate
  12. Using Parse JSON to read individual List Records in Flow|Power Automate

Thank you!!

Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate

We can be a little creative and put Flow Bot to use in Power Automate’s Microsoft Teams connector! Let’s look at a use case where you can use it to make sure Task Reminders can be handled in a friendly way.

An Open Task

Let’s look at a typical Task in Dynamics –

  1. Let’s say there’s a Task set to Joe to have a meeting with Adam which looks like this in Dynamics.

  2. In this example, I’ll ask if the user forgot to mark it as closed since the time has passed.
  3. If the user is reminded that they actually worked on it but forgot to close, they can simply click on Mark as Complete right from Teams and not bother about going into Dynamics to close it.

Flow

Here’s how I constructed the Flow. It could be different in your case. I just wanted to put an example out –

  1. My Flow runs on Recurrence. Once a day to check whether any Tasks are left Open in the past 4 hours. Then it could be tasks from the previous day or anything older than 4 hours. (Not being stringent here 😊)
    Next, I’ll get all Tasks which are open over past 4 hours. Using Fetch Xml Query as I was comfortable doing that.

  2. Furthermore, in the Fetch Xml, I’m using Link Entity to get related data. I’ll need the record Owner’s Email address and I’m fetching it from User’s entity.

    To understand how to also read related records and use them as variables, you can follow Sara Lagerquist’s post on the same with a superb explanation – https://saralagerquist.com/2019/11/25/how-to-avoid-the-get-record-action-to-retrieve-related-data-in-power-automate/
  3. Post that, I’m Parsing JSON so that I can use fields later on in the Flow to put in the Flow Bot.

  4. Now, since the Get All Tasks will get all open Tasks from the system which may belong to other users too, an Apply to Each will open up to now treat each of these Tasks as a different Flow Bot message.
    This will loop through all the Parsed results from the step above so I can easily use fields from the Task

  5. Next, is the important step. In Microsoft Teams’ connector, you’ll find this Action called as ‘Post a choice of options as the Flow bot to a user’.
    As the name suggests, this Action can post buttons as choices to the user in their chat and capture responses. Simple!

  6. This Actions will demand the following details. My Flow bot card looks like this

    Now, the Options Item 1-, 2 etc. are the places where you can provide what all options the users can get to select.

    The Recipient above should be the email address of the Teams user who should get this Flow Bot. Hence, I had selected the FetchXML query above to get the Email address from the Owner of the Task itself and parsed it to select as a field in here.

    Finally, what should be the Message inside and the Headline. Which obviously will be read by the user to understand what the message is about. Hence, Description of the Task and Subject in them respectively.
  7. Later on, based on the response of the user, if they click on
    I’ll go ahead and mark the Task as Completed in Dynamics.

  8. And just set the Task record to Completed state.

  9. And that’s it. Yours can be even more basic or complex depending on how you want to use it.

Flow Bot

Now, every once a day according to above scenario, my Flow Bot will post the below message to the user’s Teams chat.

  1. You’ll see this card posted in the chat.

  2. Now, you have two options, Mark as Complete and This is Pending. Let’s say the user wants to Mark the Task as Complete. So selecting either of the options, you’ll get place to add Comments.

    I’m NOT doing anything to the passed comments, but you can do so based on your use case.
    Also, I’m NOT doing anything when the user clicks on This is Pending.

  3. On clicking Submit, the user sees as below and the buttons go away.

  4. And when you check the Task in Dynamics, it’ll be marked as Completed.

Hope this is useful to get your going! You can use this in several use-cases to capture something from the user through their Teams chat and update and forward it to other systems.

Here are some more Power Platform, Flow, Teams posts you might like to check –

  1. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  2. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  3. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  4. Accept HTTP Requests in a Flow and send Response back | Power Automate
  5. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  6. Terminate a Flow with Failed/Cancelled status | Power Automate
  7. Pause a Flow using Delay and Delay Until | Power Automate
  8. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  11. Using Parse JSON to read individual List Records in Flow|Power Automate
  12. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate

Thank you!

There are missing dependencies. Install the following solutions before installing this one: “Active” | Connection References missing in Power Platform Solution

While importing and Unmanaged Solution into another environment, you must’ve come across these error messages like “There are missing dependencies. Install the following solutions before installing this one: “Active”

Now, there are various factors as to why this error is seen. I’ll try to cover one of them. Missing Connection References! Let’s take a look.

So, out of other reasons, one could by that there are some Flow’s Connection References that are not yet added to the Solution when it was exported out.

Error on Import

Let’s say you trying to import this Unmanaged Solution in an environment.

  1. This is your Source Solution which you want to Export and Unmanaged and Import into other environment.

  2. You see the following error on Import.

  3. Now, there are many other reasons why you are getting this error. But, in this case, it’s about missing Connection References from the Source Solution

Adding Connection Reference

In my case, it was missing adding the Connection References in the Source Solution, so here’s what I did –

  1. Go to the Add existing in your source Solution

  2. Look for Connection Reference (preview)

  3. When I add that, I can select what all Connection References are available to add.
    Here, you’ll have to select all those Connection References which you have utilized in your Solution Components.
    To understand more on Connection References, here’s a post by Alex Shlega’s posts on Connection Reference – https://www.itaintboring.com/powerapps/connection-references/

  4. When you click that, it’s added behind the scenes. Now, export the Unmanaged Solution again.



Re-Importing into Source Instance

Now, In your Source Instance, re-import this newest Unmanaged Solution.

  1. Now, importing the 1.0.0.2 version, you’ll see no issues.

  2. And when you click next, you’ll be asked to Create a Connection right away

  3. In this example, I’m supposed to create a CDS (Current Environment) connection. Because that’s what I had selected as a Connection Reference while exporting from the Source Instance.

    Skipping a few intermediate steps. My connection is created as below.

  4. Going back to the Import tab where I was importing the Solution, I’ll just refresh as directed.

  5. Any my Connection is available.

  6. I can just continue to Import as usual and it’ll be imported.

Hope this helps!

Here are some more Power Platform related posts you might want to check out –

  1. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  2. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  3. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  4. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  5. Implement character length validation in a Canvas Power App | Power Platform
  6. Accept HTTP Requests in a Flow and send Response back | Power Automate
  7. Terminate a Flow with Failed/Cancelled status | Power Automate
  8. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  9. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  10. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  11. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  12. Setting Retry Policy for an HTTP request in a Flow | Power Automate

Thank you!!

Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Now, for all the newbies working with Common Data Service (Current Environment) connector face a little constraint in order to read certain fields which are NOT in the list of the Dynamic Content of the CDS connector itself.

Scenario

Let’s say you want to read this field from the Body / Outputs of the CDS trigger in a Flow in Power Automate

Attributes (or rather supporting metadata) won’t be accessible directly since it’s not from the context of the CDS connector itself like you see for other fields as below –

Flow

In this example, here’s how our Flow will look like.

We’ll declare 2 variables after the CDS connector with Create or Update trigger on Accounts entity and how we can work with the results.

Reading from triggerBody()

When to use triggerBody() ? – When you want to fetch attributes from the body of the trigger.

Here’s how you can use triggerBody() function to read ‘RunAsSystemUserId’ from the outputs of CDS connector.

  1. Let’s say you have a variable declared to store your results. Let’s call it Trigger Body. Click on the fx sign to enter the formula

  2. Now, in the formula, enter triggerBody()?[‘RunAsSystemUserId’]. triggerBody() is a method to you’ll find it in auto-complete

  3. And the variable will look like this

Result of triggerBody() will be as below

Reading from triggerOutputs()

When to use triggerOutputs() ? – Whenever you need to access anything from within the body as well as some info from the header as well as shown in the 2nd screenshot in step #2 below.

Here’s how you can use triggerOutputs() funtion to read ‘RunAsSystemUserId’ from the outputs of CDS connector

  1. Let’s say you have a variable declared to store your results. Let’s call it Trigger Output. Click on the fx sign to enter the formula


  2. Now, in the formula, enter triggerOutputs()?[‘body/RunAsSystemUserId’]. triggerOutputs() is a method to you’ll find it in auto-complete.


    The reason this we write “body/RunAsSystemUserId” is because in the JSON structure of the complete Outputs of the CDS Connector, you’ll see that RunAsSystemUserId attribute lies inside body in the JSON.
    Whereas in terms of triggerBody() above, we are reading attributes from the “body” itself.

Result of triggerOutputs() will be as below

Hope this was useful!

Here are some more Power Automate / Flow posts you might want to check –

  1. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  2. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  3. Accept HTTP Requests in a Flow and send Response back | Power Automate
  4. Terminate a Flow with Failed/Cancelled status | Power Automate
  5. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Text Functions in a Flow | Power Automate
  11. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  12. Get Count of records retrieved in CDS connector in a Flow | Power Automate

Thank you!

Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate

Now, there are several questions about how can we make HTTP requests from a Canvas Power App. Well, as of today, only HTTP with Azure AD exists in native Canvas Power App Connectors, so in order to call HTTP requests only to external resources, you’ll need to go via a Flow and get response back.

Scenario

Call a Flow from within a Canvas Power App and capture the response back in the Canvas Power App.

In my example to keep things easy, I’m using a sample HTTP request provided by https://openweathermap.org/ (OpenWeatherMap) [I know there are native Weather connectors, but I’m just using as an example]

Flow

Here’s how Flow looks –

  1. Let’s say I create an Automated Flow which is triggered from a Power App. Just select that, there’s nothing to add to it.


  2. Next Step, I’ll make an HTTP request to a Service (In my example, I want to retrieve Humidity. You would of course have your use case)
    I’ve used the same example in one of my posts where I talked about making HTTP requests using Flow. Check this post – Make HTTP request from Flow in Power Automate


  3. To breakdown my received HTTP response into distinct pieces of info, I’ll parse it.

  4. Final step would be to send back the parsed info to the Power App itself so that I can use the info internally in the Canvas Power App from which this Flow was called.

  5. Now, I’m choosing to send back the Humidity value. So, I’ll choose a type of Output to be sent my response into

  6. And since I already parsed the response in the step above, it’s easy to select what piece of info I want to send back to my Canvas Power App.
    I’ve created a variable called as humidityValue and in that I’m passing humidity from the parsed JSON step.

  7. That’s it. My Flow overall looks like this

Canvas Power App

In my Canvas Power App, I only have a button which will populate the data into a label –

  1. Let’s say, I have a button called as Get Humidity. And below it, is a Label having “Humidity is” already written

  2. Now, the next step is to add the Flow in the Canvas Power App. Navigate to Action in the menu bar in Canvas Power App Studio and look for Power Automate

  3. On clicking it, you’ll be able to select the Flow you want to add in the Canvas Power App

  4. Once you select that, it’ll appear on the OnSelect formula bar of the button. Ideally, this should be added to whatever event you want the Flow to Run from (In my case, click of Get Humidity button)
    It’ll populate with a default formula like below. But we need some modification for it to be populated to the Label.

  5. Now, you can write the below formula to add the value retrieved from the variable which you created dynamically called as ‘humidity‘ and upon adding dot to the Run(), you’ll be able to select the variable you passed to the Canvas App from Flow.

  6. So, the completed Formula looks like this.
    Here, I’m using Set() function to set a dynamically declared variable in called as humidity and populate it with the value of humidityValue which we’ll get when we run Flow and the Flow will make an HTTP call to get that value.
    In case you also need to understand how variables work, you can refer this post of mine – Variables in Canvas Power Apps | Global and Context

  7. Now, we need to set it to the Label. So, we’ll write a formula on the Label’s Text event. So that, the Label is displaying Humidity is <valueOfHumidity> variable

  8. And you’re set. Hope this explanation was easy. Now, let’s Run the App and click Get Humidity button

Working

When I click a button, I’ll get the value into the Label field which I created.

When I click the button, it’ll be greyed out for a moment while the Canvas Power App calls the Flow and the Flow runs the HTTP request and sends back response to Canvas Power App.

Finally, once the variable is set, the Label control will display the value as below which came via HTTP using Flow

You can also see the results going in the Flow Run as well

Hope this was useful. Here are some more Canvas Power App & Power Automate posts you might want to look at –

  1. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  2. Accept HTTP Requests in a Flow and send Response back | Power Automate
  3. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  4. Terminate a Flow with Failed/Cancelled status | Power Automate
  5. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  6. Logged In User details in a Canvas Power App
  7. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  8. Implement character length validation in a Canvas Power App | Power Platform
  9. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  10. Pause a Flow using Delay and Delay Until | Power Automate
  11. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  12. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  13. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  14. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  15. Using Parse JSON to read individual List Records in Flow|Power Automate

Thank you!

Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate

Let’s say most of your users are using custom Canvas Power Apps to follow their business tasks and rely on Canvas Apps for their actions inside Dynamics 365.

There could be scenarios where you want to notify them conditionally of important items that need their attention.

Scenario

Let’s say you have a few users whom you want to tell them that an Opportunity was Won. It could be a team or a single User.

Here’s what my scenario is – A PowerApp Notification is sent to designated User(s) using Flow. When an Opportunity is Won

A Power App Notification is received

And when user clicks he Notification, Canvas Power will open and show that record.

But of course, your implementation/applications for this can be limitless!! This is just my example!

Flow

Here’s what the Flow looks like –

  1. I’m triggering the Flow on Update of the Opportunity. You can use Trigger Conditions to make sure your Flow is triggered only on the update of the Opportunity Win

  2. [Optional, according to my scenario] I want to send this to the Owner of the Opportutnity for now. Of course, it makes sense to send it to others. But let’s keep it simple for now. 🙂
    So, I’m capturing Email address here to be used further down



  3. [Optional, according to my scenario] Further, I’m only checking if the Status was Won. Status Reason = 3 meaning Opportunity was Won


  4. Next, once your condition is satisfied, you can search for this Connector and Action in your Steps in the Flow.


  5. For now, you only have this one Action which you’ll need.


  6. This is how it looks –
    Recipient Item – 1 holds the Email address of the User to whom the notification will be sent to. More can be added by using the + Add new item button.
    Message holds what should be displayed when the notification is received to the end user.
    Open App – Yes/No. Boolean to set if the Power App is supposed to be Opened upon selecting the Notification or not.
    Parameters – You can pass parameters to the Canvas App and use it inside Canvas App. Example: To open the record directly if the App is designed in that way.



  7. First thing you need to do is to create a specific connection for this so that you can use it to open the specific App in Power App.


  8. You can give your Connection a name and then the ID of the App must be entered. Once done, click create.

  9. In case you’re wondering where you’ll get the App ID. You can find the Canvas App ID in the Details section of your Canvas Power App, you’ll only need that to be copied


  10. And you can enter the below options –
    In my example, I’m sending an alert to the email I captured in #2 above.. In your case, you can set this dynamically and add more as well by clicking on “+ Add new item

    In Message, I’ll enter what the notification should read.
    Open App is set to Yes. Means if I click the notification, it’ll open the Canvas Power App whose ID I used above to create the Connection.

    Parameters, this is optional. If you want to open the specific record, you can pass the GUID like this and in the next section, we’ll see how we can open the record using that.

Canvas Power App

In the previous step, remember we sent the Guid as parameter to the Canvas Power App, here’s what you can do to read the record and use it to open the specific record.
Here’s how you can read Parameters passed to the Canvas Power App.
Param(“<ParameterName>”)

I’m using it to Lookup the Opportunity that I passed from the Notification to the Canvas Power App.

In my application, I’m using Lookup to fetch the record and set it to the Item property of the Edit Form control


Some references to use if you’re looking to Capture Parameters and Lookup/Filter data based on your GUID is that’s your implementation.

  1. Pass Parameters to Canvas Power App – https://sachinbansal.blog/2018/06/17/powerapps-canvas-app-how-to-pass-parameter-in-app-url-display-data-based-on-parameter-passed/
  2. Lookup/Filter Records – http://linnzawwin.blogspot.com/2019/12/power-apps-using-common-data-services.html

Working

Let’s say an Opportunity was Won in Dynamics 365.

And the user will receive a notification like this.


Clicking on which, they’ll be taken to the Canvas Power App record which I set in my Canvas Power App.

Hope this was helpful!

Here are some more Canvas Power App posts you might want to look at –

  1. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  2. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  3. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  4. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  5. Restore older version of a Canvas Power App | Power Platform
  6. Logged In User details in a Canvas Power App
  7. Implement character length validation in a Canvas Power App | Power Platform
  8. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  9. Number Formatting in a Flow | Power Automate
  10. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  11. Accept HTTP Requests in a Flow and send Response back | Power Automate
  12. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!