Showing posts from December, 2018

PowerApps - Building a Expanding Gallery with a Expanding Text Box

I recently built a questionnaire PowerApp for a customer.  They had a bunch of questions where the expected answers could be anything from 50-500 words. The problem was when you put too many words into a text box, it gets scroll bars. eww.

I'm not against scrollbars for a whole screen, but for text boxes, yeah no. So here's what we did!
Added a 'Blank Flexible Height' Gallery to the PowerAppConnected it to my Collection of questionsAdded a label to display the questionAdded a text box to collect the answersSet the following text box properties:Mode: MultilineHeight: 40 * RoundUp((Len(TextInput1.Text)+0.01) / 90,0)What this does40 - how tall the text box is each time you meet the character limit for one line90 - How many characters it takes to move the 40px multiplier up roundup - ensures the returned number is only ever 1 rounded number.  This means the text box grows in chunks, instead of growing with each individual character typed.+0.01 - ensures that even if the text…

Microsoft Flow - Use the Take() Function to quickly test your loops

The Take() function can be used to filter an array.  For example, if you have an Array with 1000 items in it, you can use the Take() function to only grab the first 5.
WhyOccasionally when you are building a Flow, you need to run a loop across a large array.  The loop can take hours to run depending on how many items are in the array and how many actions are in the loop.  Use the Take() function to quickly check that your loop will run successfully on a small subset of the array.
HowIn this example we are going to create an array of 10 numbers, and iterate through a subset of the array. The steps are as follows: Create an 'Initialize Variable' Action, and build an array with some values in it - here's some values for you: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]Create an 'Apply to Each' Action and do the followingclick in the blank text box, navigate to the 'Expression' Tab and type: take()now click on the 'Dynamic …