Friday Flow: Using Microsoft Forms with Power Automate

At the company where I work we regularly have knowledge transfer sessions called Brown Bag Lunches (BBLs) which I think is a great way to share and give back. I am in charge of scheduling these.

I wanted automate the process for planning these sessions and give my colleagues a way to submit suggestions for content. I started by setting a simple Microsoft Form for them to add suggestions

Sorry about the Swedish 🙂

Microsoft has a page for looking at the results of the form submissions which I could have used to get the subjects and plan them manually… but where is the fun in that :-). My solution was to add a flow that is triggered every time a form is submitted which adds it to an excel spreadsheet and adds a todo task in my todo list of choice Todoist.

The result from Forms is in a JSON format so the first thing we need to do is to parse the JSON message.


The parsing of the JSON also means that we can use the content as dynamic content and add it without having to write an expression… the No-Code way. The JSON message also only contains the response id so we will have to use a “Get response details” block to get the actual information of the form.

The reason we are extracting the information is to put it in the Excel file… The response only contains the submitting users email adress so to get the excel file to look a bit nicer I use the Get User Profile block to look up the users real name from the Azure AD/SharePoint. This is a really cool block since it can get a whole lot of cool info from you organization such at a users manager etc.

Finally I add a line to an excel file and put a reminder i my todo list

I would really continue building this logic to automate the planning even further… I might have to revisit this in a later post 🙂

Have a nice weekend

Johan

Flow Friday: Troubleshooting ‘shared_sharepointonline’ doesn’t exist

When trying to build a flow yesterday I got a confusing error:

Unable to process template language expressions in action ‘Create_Sprint_Period_in_Sharepoint’ inputs at line ‘1’ and column ‘2778’: ‘The template language expression ‘json(decodeBase64(triggerOutputs().headers[‘X-MS-APIM-Tokens’]))[‘$connections’][‘shared_sharepointonline’][‘connectionId’]’ cannot be evaluated because property ‘shared_sharepointonline’ doesn’t exist, available properties are ‘shared_office365, shared_todoist’. Please see https://aka.ms/logicexpressions for usage details.’.

The reason for this error is that you are test running the flow using data from a prior test from before you added the missing component (in this case sharepoint). You simply need to trigger the flow again med fresh data and it will work

Johan

Flow Friday – Troubleshooting Tips

This weeks Flow Friday is a bit late… Sorry…

Sometimes it can be a bit tricky troubleshoot flows… espesially if you are not fluent in JSON (I’m not). Trying to figure out exactly how to write the formula might sometimes require a couple of tries and my first solution to this was to send my self an email.

There is a better solution… You can use the compose function to get everything working. Just add the function you want to test in the Compose Window

The formula I added was this one

adddays(triggerOutputs()[‘body’][‘date’],1,”)

I am just trying to add one day to a date field that I input manually in the previous step.

When you have run the Flow you can just look in the run history for the output of the compose step

Flow Friday – Feeding news to MS Teams – Part 2

So… Apparently Flow is not Flow anymore 🙂 Flow is now called Power Automate but since the actual flows still are called flows I will keep the name Flow Friday…

Last week we startad posting news to Microsoft Teams… today we are expanding that concept… Same basic flow with a nice look and more news sources

Since we are not able to add multiple trigger to a Flow (yet?? *hoping*) and I am too lazy to build multiple flows… that would be cheating.

The multiple news sources requires a workaround using an external service called RSSUnify (there are other services that you can use). Go to RSSUnify and add all your feeds.

Then you copy the resulting RSS URL from RSSUnify and add it to Microsoft Flow

In order to refine the flow even more I want to make the Teams posting a little nicer. To do that I use the action “Post your own adaptive card as the flow bot to a channel (Preview)”. To design the look of the card you can either write your own JSON design or you can use this tool. I created a minimal card and the post information.

The card posting action has issues handling HTML which means that I will have to convert the summary into Plain Text. In order to fix this I add an action called Html to Text and then add the result to the adaptive card.

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "TextBlock",
            "text": "[@{triggerBody()?['title']}](@{triggerBody()?['primaryLink']})",
            "weight": "Bolder",
            "size": "Medium"
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": "stretch",
                    "items": [
                        {
                            "type": "TextBlock",
                            "spacing": "None",
                            "text": "@{body('Html_to_text')}",
                            "isSubtle": true,
                            "wrap": true
                        }
                    ]
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "",
            "wrap": true
        }
    ]
}

The post looks like this:

That is it for this week

Links:
https://adaptivecards.io/
https://rssunify.com/