Any views expressed within media held on this service are those of the contributors, should not be taken as approved or endorsed by the University, and do not necessarily reflect the views of the University in respect of any particular issue.

...in which I don't go up mountains

Tag: PowerPlatform

A row of white doors with one yellow door

Fixing two identical strings that don’t match in Power Automate

Reading Time: 3 minutes

Recently I’ve been working on a Power App for academic and teaching office staff to organise feedback on postgraduate dissertations. Microsoft recommend a maximum of 30 connectors per Power App, so I decided to pass the course codes to Power Automate, where a Switch action could be used to choose which course’s SharePoint lists to read data from.

This is how I had set that up in Power Automate:

Diagram of a Power Automate flow, showing course codes being used in a Switch statement to choose between subsequent actions

The Switch statement compares the course code passed in from Power Apps with text strings providing the code for each course. It should match one of them and then follow that course of action. But it didn’t. The two seemingly identical strings didn’t match, and the flow ran into the default (matching none) condition instead.

Two road signs pointing to the same location in opposite directions

Confusing road sign at Elan Village
cc-by-sa/2.0© Chris Henleygeograph.org.uk/p/265977

Painted artwork showing pictures in a spiral formation on a turquoise background

Using a Toggle to make a While Loop in Power Apps

Reading Time: 3 minutes

Picture: One Infinite Loop, Ignacio Sanz, CC BY-SA 2.0, via Wikimedia Commons and Flickr

The Problem: Power Apps only has ForAll Loops

When I was creating a demo Power App to fetch and display Dad Jokes, one of the challenges I faced was to fit the joke text inside a speech bubble graphic. The speech bubble was expandable, but only within limits, so I needed to keep fetching jokes and checking the length of their text until I found one short enough to fit inside the bubble design.

Power apps editor screenshot with the text 'Too long'

After clicking the button: the app enters the loop and the text changes to ‘Too long’

However, looping in Power Apps turned out to be tricky. Unbelievably, I discovered there is only one kind of loop in Power Apps: ForAll, which is used for looping over tables and collections. Power Apps really doesn’t have any other kind of loops, or even GoTos in the coding it makes available.

Making a While Loop in Power Apps

However, after much research, trial and error, I found a way to do this with just the loop (More Dad jokes) button and a hidden toggle:

Gallery screenshot with tags displaying

Making an OAuth2 Custom Connector to fetch data from the Stack Exchange REST API in Power Apps

Reading Time: 26 minutes

 

Introduction

This post describes a Power App that fetches and displays data from the Stack Exchange REST API using OAuth2 authentication, with a custom connector created by importing a collection from Postman.

Why did this happen?

This is a step in my ongoing project to access our Blackboard Learn Virtual Learning Environment using REST APIs. I thought this might be possible using Microsoft Power Apps, which would allow the development of apps more quickly, but getting the connection itself figured out was proving complex(*here’s why).

The first step in testing out this theory was my Dad Jokes Power App, which did not require any authentication.

Once that worked, the next step was to try the same process with another REST API that used the same kind of OAuth2 authentication process as Learn. After searching through various free public API lists, I found the Stack Exchange API, which seemed to match the authentication process fairly closely, and has good instructions too.

I also thought it looked useful in its own right, both for keeping up with news from developers, and for trying out methods for searching, sorting and filtering data when I got further into the Power Apps side of app development.

Screenshot of a Power App that fetches random jokes from a REST API

Making a Dad Jokes App using REST APIs and Power Apps Custom Connectors

Reading Time: 30 minutes

This post describes a Power App that fetches and displays data from a simple REST API using a custom connector created by importing from Postman. The app also uses a Toggle control to create a While loop in Power Apps.

The app itself can be found here: https://apps.powerapps.com/play/f1478489-b888-4e8a-9fe5-8c244e126e70?tenantId=2e9f06b0-1669-4589-8789-10a06934dc61, but is sadly only available to those with a University of Edinburgh login, as this app is a personal educational project and is not for publication or profit.

Why did this happen?

I’ve recently been working on a project to access our Blackboard Learn Virtual Learning Environment more efficiently using REST APIs. It occurred to me that this might be possible using Microsoft Power Apps, which could allow the development of apps more quickly, if we could get the connection itself figured out. The Dad Jokes app was developed as a proof (or otherwise) of the concept.

Presentation slide introducing the Global Microsoft 365 Developer Bootcamp

Day 1 of Microsoft 365 Global Developers’ Bootcamp: Getting Set Up with Teams, SharePoint and other Microsoft Accounts

Reading Time: 5 minutes

Recently I had the great opportunity of attending the Microsoft 365 Global Developers’ Bootcamp. This consisted of two workshops, each going through a series of activities around a themed task, developing applications for use with Microsoft Teams, and using the Microsoft Graph API.

The workshop for Day 1 was ‘Build an Emergency Response Solution with Teams and SharePoint’.

This workshop was run by Bob German, and it took us through a series of tasks to create a Teams app for coordinating the response to an emergency such as a natural disaster. It grew out of work done to help with the aftermath of the 2004 Boxing Day Tsunami in Asia.

Presentation slide introducing the Global Microsoft 365 Developer Bootcamp

Photo of a Qi Gong pose

Using Flow with Teams, part 2

Reading Time: 19 minutes

Recap

This is a follow on from my previous post, ‘Using Microsoft Flow to update a Teams group with SharePoint activity‘. Flow is also known as Power Automate, and it is a Microsoft method for connecting apps so that outputs from one app can become inputs to another app, and events that happen in one app can trigger procedures in another app.

In my previous post, I added Flow to a Microsoft Teams group, and set up conditional testing to post a message in one of two Teams channels, depending on the value chosen in a metadata column when a file was uploaded to a SharePoint library belonging to the Team.

The Plan

The next steps to improve on this Flow will be:

  1. Changing the SharePoint column name to ‘Relevance’ and the option labels, Teams channel names and Flow conditions to say ‘Urgent’ and ‘FYI’ rather than ‘Yesterday’ and ‘Never’. This morphed into the far more complicated problem of waiting for the SharePoint column value to change before continuing the Flow.
    Jump to this section.
  2. In the message that’s posted to Teams, change the text displaying the uploaded file’s URL to a working link to the file.
    Jump to this section.
  3. Post the message in Teams using the name of the person who uploaded the file to SharePoint.
    Jump to this section.
  4. Another thing I would like to do is to add the updates as cards in ‘To Do’ columns in the Teams group Trello board.
    Jump to this section.
  5. Summary: Bringing the last few things together. Jump to summary section
  6. Jump to links
Photo of a red squirrel

Using Microsoft Flow to update a Teams group with SharePoint activity

Reading Time: 6 minutes

I resumed my progress with Microsoft Flow after a pointless side quest attempting to change my favicon in SharePoint. I had very little success there, though I learned a lot, but with this, thankfully, I am having better luck.

To get started, I watched some of a video course on LinkedIn Learning: Microsoft Power Automate: Beyond the Basics, with Gini von Courter. I’ve watched enough of these now that I find Gini quite calming and pleasant to listen to: it’s a no nonsense way to get back in the frame of mind for the Microsoft universe (which is like the Marvel universe, but kind of solid, unmoving and heavy).

As it turned out, this course was ideal for me, because I’d already set up a Teams group for my current project and Gini started off with adding Microsoft Flow to Teams. Being quite new to Microsoft Teams, I hadn’t thought of doing that before, but it does make a lot of sense and offers some useful opportunities worth practising.

SharePoint screen for creating a new subsite

A Practice Site for SharePoint and Flow / PowerAutomate

Reading Time: 3 minutes

Having overcome (thank God) my initial stumbling block of all-consuming dread, I have begun building a practice site for using SharePoint document libraries and lists with Microsoft Flow (or PowerAutomate as I think it is now called).

Powered by WordPress & Theme by Anders Norén

css.php

Report this page

To report inappropriate content on this page, please use the form below. Upon receiving your report, we will be in touch as per the Take Down Policy of the service.

Please note that personal data collected through this form is used and stored for the purposes of processing this report and communication with you.

If you are unable to report a concern about content via this form please contact the Service Owner.

Please enter an email address you wish to be contacted on. Please describe the unacceptable content in sufficient detail to allow us to locate it, and why you consider it to be unacceptable.
By submitting this report, you accept that it is accurate and that fraudulent or nuisance complaints may result in action by the University.

  Cancel