Make HTTP request from Flow in Power Automate

One of the most common asks I’ve come across lately is people asking whether or not, we can make external HTTP requests using Flow in Power Automate. Well, yes! Let’s quickly take a look at how you can do that.

Scenario

To keep the example really simple, I have an API that I can use to call to get weather information. (By the way, you’ll find MSN Weather connector in Power Automate too)
So, the API I’m using to test the call is OpenWeatherMap. Their API is really easy to understand for this example.

Note: You can create your account here and you’ll get an API key which you can use.

  1. Now, Let’s say I have the API key and I’m ready to consume their API.
    You can have your Flow start any which way you want, I’m just running it on schedule –
    Select HTTP in the search and select the HTTP trigger
    selectAction
  2. Now, I can fill in the data required to make the HTTP call. In my example, the API is expecting Query String, so I’m passing the values in Queries as needed. It could be different in your case.
    I’m select GET method since we are trying to retrieve data by calling the API
    getSelected

    And then go on to write the rest of the request.
    sampleRequest
    Let’s say, if you’re required to pass headers to a POST request with Body, you can do that as well.

  3. And I’m capturing the response in a variable in Flow to further use it. I’ve chosen to store it in an Object type of variable.
    captureResponseEasy!

Making HTTP Request

Now, let’s test it. I made a sample request and I’ve received the response as below –
I’ll open my response part –
openResponse

Check this, in case you want to also secure the data your receive – Secure Input/Output in Power Automate Run History

And I’ve received the data successfully! Hope this gets you started in making HTTP calls.

Retrieve only active Dynamics 365 CE licensed Users in CDS connector in Power Automate

Let’s say you have a requirement where you want to work only on Dynamics 365 and you are using Office 365 Get User Profile action to retrieve all users.

In this example, I have some Dynamics 365 Customer Engagement licenses assigned to uers. And I want to retrieve only the Active D365 Users in my Common Data Service Connector.

Here’s how I do it –

Retrieve Users with Filter Condition

Now, the best thing you could do is identify what is the userlicensetype field of other Dynamics 365 users you might have retrieved in your previous executions.

licenseTypeFilter

I’ve used the query userlicensetype eq 6 to query for Active D365 users

If you want to retrieve Users who have been Disabled, you can check by using userlicensetype eq -1

Note: You’ll need to check the respective values for other users who have licenses like Team Member or Sales Professional. Since I haven’t tried those, I don’t have their exact number codes. Best way is to identify a user whose licence configuration you are looking for and look for their userlicensetype field value in Flow.

Result

This gave me only those users who have D365 Customer Engagement License assigned to them
4retrieved

And if I look at my O365 Portal, I can see that 4 users have the Dynamics 365 Customer Engagement License
D365Licensed

There are even more ways you can use to identify for different licenses used. I recommend it’s good practice to retrieved only those users which are needed for your operation.

If you’re also looking to secure the Input/Output data in Flow, refer this Secure Input/Output in Power Automate Run History

Hope this helps!

Create a To-Do List Item of Important Outlook Emails using Power Automate

Since Power Automate is so powerful that you can creatively use it to improve your productivity at work. Here’s an example of how you can utilize a scenario where you need a quick checklist to make sure you respond all important emails for the day.

Power Automate

  1. You’ll need to create an Automated Power Automate and select the trigger as Office 365 Outlook. Select ‘When a new email arrived (V3)’ from the same and make sure you only select the High Importance marked emails
    selectOnlyHighImp
  2. Next step, create a To-Do Item. Select the List you have created. In my case, I created a separate list called ‘Respond Important Emails’
    toDoList
    And the step to configure the To-Do List item should be like this –
    addToDoStep
    In the above picture, I’ve made sure I select the correct List I want to create a To-Do in.

    And to give myself some time, I’ve added a reminder time of 2 hours from the time this Flow/Power Automate will run i.e. when the email will come in –
    add2Hours

How it works

Now, when an Important email will arrive in my Inbox as below –
actualEmail

Power Automate will create a To-Do in my created List
newItemAdded

And it will look like this –
reminderIn2Hours
Also, the reminder is set to remind me 2 hours post the time the To-Do item was created. Just in case I’m into something else, I’d set myself a reminder.

Hope this helps! And you can use your creativity to improve your productivity!

RSS notifications to your phone using Power Automate

RSS is powerful and taming it wisely really helps! 🙂 Here’s an example where I used it to get a notification whenever a new blog was posted by Microsoft in their Dynamics 365 Blog page. It is my attempt to stay updated on the latest posts so that I don’t miss anything.

Scenario

  1. Let’s say, for example, this is the website I want to read RSS feeds from. So click on the RSS icon – https://cloudblogs.microsoft.com/dynamics365/
    feedIconOnWebsite
  2. Copy the URL from the Feed page
    copyURL

Build your Power Automate

  1. Start by building your Power Automate, you can select the Trigger as RSS.
    createFlow
  2. Paste the URL copied from your RSS source above, and then add a step to send a Notification. You can have anything here, it’s up to your use case of what you want to do with the Power Automate further on.
    powerAutomate

Getting RSS Feeds on Phone using Power Automate

Now, once all this is set, here’s how I’ll get notifications on the phone once I have Power Automate setup and authenticated to the correct environment of Power Automate.

  1. Whenever there’s a new blog posted on https://cloudblogs.microsoft.com/dynamics365/, I get a Power Automate notification on the phone like this
    phoneNotif
  2. And when you click on it, you’ll see what has been posted, it will open up in the Power Automate app
    openPA
  3. And when you click on the link, it will take you to the actual blog Post
    actualPost

 

Hope this helps you in your application or use case! Cheers!!

 

Selecting (Current) in Environment in Power Automate CDS connector and why it matters

If you’re new to Power Automate, you must be wondering why am I given an option to select either (Current) or the actual name of the environment. Why can’t I just select the actual name?
selectEnv

Well, here’s why –

Importing into Other environments

So, when you import your Flow / Power Automate into other environment using a solution, be it from Sandbox to Production or to entirely different org in different tenant, here’s the behavior

(Current) selection

currentSelected

And if you Export this Flow and import into other Organizations, you can simply restore the connections to that organization by simply selecting the connection
authenticateCurrent

And it will be loaded with the current environment(s) as it was on the source environment
currentLoaded

Environment selection

Whereas now, if you have exported the Flow with Environments selected as the particular environment and not (Current) like below –
envSelect

When you import this into other environment, and when you try to authenticate, it will not go through and you’ll see something like this –
corruptedEnv

And if you wonder what the Org name is displayed in the picture above, it’s the Org Unique Name of the source environment
uniqueNameOfOldOrg

 

And that’s why, it’s critical to select (Current) environment when you develop flows and you know you want to have these imported to other environments.

Hope this helps!

Button Flow in Power Automate to replicate a Quick Create Form in D365 CE

I wanted to try a quick example of a Flow Button. I thought, why not make a simple Quick Create like form to enter data in Dynamics from Flow itself? So here’s a little form I did –

Create Button Flow in Power Automate

Now, let’s start of by creating a Flow button itself.

  1. Choose the template to create a Flow button.
    createFlowButton
  2. And give a suitable name and select the Flow trigger which is a button
    createAccountNew
  3. Now, select what input controls you want to add to the Flow Button. Click on Add Input and then select the Input you want to start off with
    addInput
    chooseControl
  4. Now, since in this example, I’m trying to create a simple Quick Create like form for D365, I’ll choose the most obvious fields I want and create the inputs as below
    buttonLayout
  5. Further, I’ll connect the same to CDS and Create a record in Dynamics using the input I receive from the Flow button, so – my CDS mapping in the Flow below looks like this –
    upperFlowBody
    I’ve mapped the Company Name and Annual Revenue fields.

    And now, I map the remaining Email address field to create my record.
    lowerFlowBody

    My Flow is now ready and after testing it, I’m ready to use it on my phone.

Run the Button Flow on Phone

On the phone app, make sure you have access to the Flow and navigate to Buttons on the screen-

  1. In Power Automate app, open the Buttons section and check for the Flow Button you created – Create Account in this case –
    buttonView
  2. Once you push the button, you’ll see the form you created with the input fields
    blankForm
  3. Finally, when you fill out the form, you’ll simply need to hit Done and that should be it.
    readyToSubmit

 

Check the Record in D365

Now, if you check in Dynamics, the record must’ve been created already!
record

 

Hope this quick tutorial helps!!

Secure Input/Output in Power Automate Run History

Isn’t it just too easy to see from Flow (Power Automate’s) Runs what data was passed on? A simple switch in the Power Automate designer will secure this.

Default Behavior

By default, if you have access to the Flow, you can simply go in and see the inputs
openData

Secure Input / Output

In the Flow designer, you can select and step and go to Settings
settings

And turn on Secure Input / Output depending on what you want. It says this is still in Preview as of the day of writing this post.
turnOnInputs.png

Once this is Active, it is denoted by a Lock symbol on the step you enabled it on.
denoted by Lock.png

And now, when you try to look at the data, it will hide away the information
securedData.png
Note: Please note that this will run only for the Run History records after this was turned on. The previous records will continue to show the data.

Also, in case you’re curious to know about the Approval Process using Power Automate, you can refer this post – Approval Process using Power Automate

Hope this helps!!