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

Month: March 2024

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:

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