Tag Archives: PowerApps
How to create Dynamic Option-set/List based on value from other fields in Canvas PowerApps
Hi Everyone, Consider a scenario where we want to filter out a dropdown/combo-box choice field based on value in other field or dropdown.Since we cannot use scripts in Canvas App, here’s how we can show specific choice based on multiple values For this example, I’ve considered a bunch of basic items belonging to Fruits, Vegetables and Dairy products. For example purpose I’ll be creating a collection of values to representation. This step will be avoided for choices field within a table/entity.Below is the ‘Master Record’ of collection. Step 1: Create an indexed collection. (referring to MasterList in this example) Step 2: Let’s say we would like to classify the Master List into 3 categories (Fruits, Vegetables and Dairy). In this example, I’ll be using a dropdown list for which the main dropdown field is required to filter data. I’ll be adding a hidden button, containing the following code Based on the above code,Type 1 refers to “Fruits”, Type 2 refers to “Vegetables” and Type 3 refers to “Dairy” Step 3: Added dropdown which will hold classification values. Step 4: The main dropdown choice field which will be filtered based on categories mentioned by above dropdown. That’s it. We have successfully implemented the dynamic choice list as per values dependent on other field. Hope this helps you.
Quick Tip: How to get a quick Pop-up on a control which holds a detailed information than its size on screen in PowerApps
Hi Everyone, Isn’t it annoying that you have a text field in your Canvas App which holds a huge information to fit in a small space?There’s a quick solution which you can use to show a mini pop-up by an out-of-the-box feature. Let’s consider an example of where we have a paragraph in a text field then we have output is to be displayed with a limited height and width on the screen. Fig 1: This is a TextInput control where we have a detailed information.Fig 2: This is a normal label/text field control which has limited height and width. (Especially in scenarios like gallery records)Fig 3: This is a ComboBox control with DisplayMode set to View and the DefaultSelectedItems property is set as [TextInput.Text]We can see that when having more data, we can click more and see the entire information. Hope this quick tip helped you in your scenario.
Export Power BI data to CSV via Power Automate visual and upload to SharePoint
After PowerAutomate was added in PowerBI as a preview feature, it is finally available for general use. In this blog we are going to use this PowerAutomate visual to export PowerBI data into CSV and upload the CSV on Sharepoint. Open PowerBI Desktop and drag the PowerAutomate Visual, if it isn’t available in the visualization pane update your PowerBI Version. Now add the columns, you need in your CSV file. Click on the ellipsis button on the visual and select edit. Create new flow and select instant cloud flow. A default PowerBI trigger would be created, click on add new step. Search “Compose” action in the search bar and select it as we have to compose PowerBI Raw data first. In the Inputs select PowerBI Data. After composing we have to convert this data into CSV, therefore add “Create a CSV table” step and add previous output. Now we have to upload this CSV into sharepoint so we will add a step to create a sharepoint file. Enter the Sharepoint address, Folder Path, give the file any name desired and put “.CSV” as suffix. Save and close the map. To run the flow, press Ctrl and left click. As you can see the file in SharePoint is created. Thanks for reading, hope this blog helped!
Create Custom Recommendation on Form within Canvas Power Apps
Hello, everyone! We know that Recommendations are created using Business Rules, but that only works on Model Driven Apps. As a result, we’ll develop Custom Recommendations that are flexible and customizable to our needs and enhance our App. This is how the Custom Recommendation looks, Let’s start with a simple use case, I want to set ‘Preferred Method of Contact’ field as Phone when User enters data within ‘Phone’ field within the App. Step 1: Add an Edit Form in Canvas Power Apps where the Recommendation would be applied. Step 2: Within Form properties, Click on Edit Fields Add Custom DataCard. Drag your Card below the DataCard where you need Recommendations. Step 3: Within the Custom DataCard, enter necessary information that you like in your App and use below condition. Step 4: For Apply button, I’m using context variables that sets true when click and remains until record is saved or the current screen is Active. Step 5: For changing values in my combo box on field ‘Preferred method of contact’.Note: Based on your requirement, this will change… That’s all. Hope this helps you.
How to extract information from XML/HTML/FSON and convert it into PlainText in Canvas PowerApps without Flow
If you are curious about the data in XML/HTML/JSON and want to fetch data from it without flow. Here’s something what you can do There’s an inbuilt function in PowerApps that converts HTML/XML to string text. Function Name is ‘PlainText‘. But all tags are neglected and extracting certain data is difficult. Consider you want to extract a small size information which is in XML/HTML/JSON and don’t have time to write a flow. Here’s what you can do I have a XML data.Tip: When converting your XML/HTML to PlainText. It’ll show space and next line if you place tags correctly. Keeping in 1 line or no spaces will reflect in result which will look bad. I have created 2 buttons and 2 input text boxes. 1st button will set XML/HTML/JSON in a variable or collection 2nd button will check for next values if tag found. 1st and 2nd input Text Boxes represent start and end tags There are 3 main variables that we’ll use to iterate the values. Here TagFind, TagFind_End are 2 input text boxes and var1 is variable holding XML data. Find function finds data which is encountered once. Since it has starting point we define it to iterate to next search. Current and CurrentEnd will represent start and end point of tag.Next will determine next index to start searching from We will have 1 label to show our answer Here the text property has the formula that retrieves data within the start and end point of the tag. Finally you will achieve something like this, You can use this fetched data somewhere in your PowerApp. You can also use something similar to extract values in branched data form. In a certain range of data.For example; In above XML, i have ’employees’ as 1 tag determining contents in it.If i had Name tag in employees and Name tag in ‘Department’ then by range of ‘Employees’ or ‘Department’ i can fetch Name of that block only. Hope this idea helped.
Control elements in PowerApps with different font-size
Its good to have a user’s choice based font-size but without controlling how it displays on screen may not look good. I have created a simple design that consists of a header, gallery and font-size slider to show how elements react on certain font size. Here’s how it looks. How to make this, Set your font-size range into slider or any other control element like dropdown.Set Title or any text as value of slider or dropdown and use increment or decrement as per requirement.For example: Header title is X then sub-header will be X-2 font-size. To make gallery change its style as per font-sizeSelect ‘Wrap-count’ property of gallery and insert formulaIf(Slider.Value > 25, 1, 2);This will make 1 column is font size is more than 25 else 2. You can create this on every control/elements that requires such change. Hope this helped.
Create a Custom Real-time Loader Control in Canvas PowerApps
In Canvas PowerApps, we usually show an image that lies over the screen until an execution is completed. But tracking real-time update might be confusing. I’ll show you a simple custom loading control that not only show execution status but also look good and is highly customizable. Here’s a preview how it will look (Note: Determine your layout before hand like X,Y, Height and Width)(Customize your look, I’ve added dots above just for demonstration purpose.)How to make this, Elements used visually are, Create a Rectangle as main background and set Height, Width, X and Y. (I’ve used light grey color) Insert another Rectangle to show loading animation which will fit inside main Rectangle.Determine its Height, Width, X and Y. Label control to show current status or add a simple static label. Gallery Control having circle in them i.e.: Dots (Optional, I used to show how i retrieve data as its similar to Navigation Screen Gallery Control used in 1 of predefined template in Canvass PowerApps) Functionality behind used are, Gallery Control under ‘Items’ I’ve added table. (Based on your content, keep total count of steps you would like to see in loading page. In my case, i have 6 steps) Label Control that shows current status based on current step. Rectangle with loading animation. (Note: Your step count and width may vary) Now you may have a button that will call list of execution that you will perform. To track every successful completion of process just add this, Later reset count and turn visibility off. (Note: This is re-usable and can be used as component.) Hope this helps.
Create a Custom Dropdown Control in Canvas PowerApps
As we know that a Standard Dropdown control do not have enough features and has limited properties to modify. Hence I have created a custom dropdown menu. Some drawbacks in Standard Dropdown,1. It shows only 1 particular attribute as value. Example: “Name”2. If multiple records of same name exist, then you cannot differentiate them. This is Custom Dropdown I have created, Steps to make the custom dropdown menu Step 1. Insert a ‘Text Input’ and ‘Horizontal Gallery’ and set height of gallery of your desired height also change Template Size according to fields added into a row. (As I have added only Name, Phone and Image) Step 2: Add an Icon ‘Down Arrow’ at the right of ‘Text Input’ and change property. onSelect = UpdateContext({showDropdown: !showDropdown}) //Condition to show/hide the CustomDropdown (Gallery). Step 3: Property to be changed.‘Text Input’ changes below, Default = textVal //It’s a Variable Fill = // Anything you feel suitable, I used “RGBA(230, 230, 230, 1)” Height and Text Size = // Anything you feel suitable. onChange = UpdateContext({showDropdown: !IsBlank(Self.Text)}) // Condition to show/hide the CustomDropdown (Gallery). ‘Gallery’ changes below, Items = Search(Accounts, TextInput.Text, “name”) // Filter Parameter by text. showScrollBar = false TemplateFill = // Anything you feel suitable, I used “RGBA(255, 255, 255, 1)” TemplatePadding = 10 TemplateSize = // As per your contents in a row Visible = showDropdown //It’s a Variable Step 4: To add functionality of basic dropdown on selection.Add a button to of size equal to template Size (i.e: cover entire record section) and change properties given below, onSelect = UpdateContext({textval: ThisItem.’Account Name’}) //Defined variable HoverFill = //Anything you feel suitable, I used “ColorFade(RGBA(240,240,240, 0.3), -10%)” Step 5: Custom Dropdown complete. You will have something like this, Note: For additional responsiveness in design, change X, Y, Height, Width. Hope this helps!
Custom Card in Canvas Power Apps
In this blog will see custom cards in Power Apps Use Case: I wanted to separate fields on form by label and it was looking like below: here what i am came up with add custom card on form and try adding label on the Card. Add Custom Card Select form -> Click on edit fields Click on Add a custom Card Custom card will look like this, now change the position of card and try to move it below Name field. To change the position refer this blog: After Changing the Position of card: Now change the width of Card Add Label on Card and change color or style accordingly. and now add fields on the form Here is the final Output: Conclusion: in this we way we can separate fields by adding labels on the form in Canvas Power Apps.
Form Validation in Power Apps — Part 1
In this blog, we are going to see how we can do the implementation of form validation in Power Apps. Let get started, I have designed the Sign-Up page which has the following fields: Email Password and Confirm Password Phone Number Following is Screenshot of my Sign-Up Page build in PowerApps: Following is App Controls Structure which I have followed to Create Sign Up Form: I have used “ErrorText” which is HTML Label Control for Logging all the Validation Errors. Now, we will set the Properties on ErrorText control to display the error on the Form for Each Input Following is an explanation of each validation which I have used in this Power Apps: Email Validation Not(IsBlank(‘ControlName’)) — It will validate if Field is blank or not. IsMatch(‘ControlName’.Text , Match.Email) — It will validate the email format and return false if user enter invalid Email Address Code: Password and Confirm Password Validation Not(IsBlank(‘ControlName’)) — It will validate if Field is blank or not. ‘Confirm Password’.Text = Password.Text — It will validate if the password and confirm password are the same or not. It will return false if both password will not match. Code: Phone Number Validation Not(IsBlank(‘ControlName’)) — It will validate if Field is blank or not. IsMatch(‘Control’.Text, “Your country Phone Validation ReGex”) — It will validate if the entered phone number is valid or not using ReGex. I have used phone number validation ReGex for India — “^[6–9]\d{9}$” Following is an explanation of my ReGex: 5. Code: Following is full code for Validation you need to paste in Formula bar of HtmlText Property: Result: Blank Field Validation for each Fields — Email, Password, Confirm Password and Phone Number Email Format Validation Now, you can see after entering valid email error has gone Password and Confirm Password Match Validation Phone Number Format Validation Check After adding valid phone number error is gone Hope this helps, stay tuned for more blogs.