Tag Archives: Microsoft Power Platform
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.
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.
Form Validation in Power Apps — Part 2
In this blog, we will implement the following validation on our Sign Up Form in PowerApps: Disable Sign Up button if any invalid input is present in Form. Change Border or Fill Color Input which is invalid. Before moving forward please check out my previous blog because this blog is a continuation of my previous blog. Click Here Disable Sign Up button if any invalid input is present in Form Select the Sign-Up button in the form. 2. Select the property DisplayMode so that we can change Display Mode to disable if any invalid input is entered on Form 3. Add the following to in DisplayMode Formula Bar If(ErrorText.HtmlText = “”,Edit,Disabled) It means that when Error Text is empty it will enable the submit button or else it will disable it. Change Border or Fill Color Input which is invalid. Now we will add function in Fill and border to input if that input is Invalid. Email Input Select the Email Input and choice BorderColor Property. 2. Now, In BorderColor we will add the following code in the formula bar, so if Email Input is invalid or not in the format it will change the border color of input to red or you can add whatever color you want. 3. Code : 4. You can see in the following screenshot when an email is invalid or empty then the input border is red. Password and Confirm Password Input Password and Confirm Password Input 2. Now, In BorderColor we will add the following code in the formula bar, so if Password value doesn’t match with Confirm Password Input it will change the border color of input to red. 3. Code: 4. You can see in the following screenshot when password / confirm password does not match or empty then the input border is red 5. For Confirm password Field you can follow the same step as Password Field Phone Number Input Select the Phone Number Input and choice BorderColor Property 2. Now, In BorderColor we will add the following code in the formula bar, so if Phone Number Input is invalid or not in the format it will change the border color of input to red. 3. Code: 4. You can see in the following screenshot when phone no is invalid or empty then the input border is red. Here we finish with our blog, I hope this helps a lot and stay tuned for more blog like this. Thank you
Create Fruit Detection App inside Power Platform — PowerApps and AI Build
Before you begin with this Blog, please read my previous blog which was on How to Create Object Detection Model inside the Power Platform — PowerApps | AI Builder. In a previous blog, we have created the Object Detection Model that we are going to use in this blog. Step 1: Expand the AI Builder section in Power App and click on the Models. Open Fruit Detection Model that we have created in the Previous blog series. Click on the Use model and select the Create new App. It will redirect to the Power App Builder Studio. Step 2: You will see the Object Detector Control will automatically on the screen. Your application is ready you can run the detect the objects. Step 3: Now, we will insert the Gallery Control so that we can see the count of each object present in the images. Click on Insert and Select on the Add gallery. If you are not able to see the Option Expand the ribbon from Top right Side. Select Vertical and choose Title and Subtitle. Step 4: Click on the Gallery Control and set the property to ObjectDetector1.VisionObjects Click on the Title and set the property to ThisItem.displayName Click on the SubTitle and set the property to ThisItem.count We will do some changes in the font and alignment of the control so that the application should look simple, readable & accessible. Step 5: Click on File and Save the PowerApp. You can give the name and icon to your PowerApp. Your App is ready you can select your app and click on the Play. And Click Detect it will open your file explorer to select the images. If you are using this application on the mobile your camera will be open. Following is a screenshot of Application with detected Object Inside it. I hope this helps you to understand how to create an Object Detection models and use that Model in Power Apps.