Category Archives: PowerApps
Enable Record as Active or Inactive record in PowerApps
Introduction: In this blog, we will learn how to Enable multiple records as active or inactive record. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Deactivate or Active Button on top of the Grid, it should Deactivate every record which is selected through the checkbox which is there on every record of the Grid. Steps: There is a Screen on which there a Editable grid of custom Entity Objective. To Create an Editable Grid refer to the following link. To add Lookup Fields in the Grid refer to the following link. This is the grid with a checkbox. To Deactivate or Activate selected records, first create a Collection: OnSelect property of the Deactivate Button: When we select the Deactivate Button, it will collect all the records where the Checkbox is selected. To Deactivate the records from the CDS, set the OnSelect property of the Deactivate Button to the following formula: OnSelect property of the Deactivate Button: Combine the Whole formula in the OnSelect property of Deactivate Button : For eg: DeactivateSelectedRecord.OnSelect = Note: For Activating the record just replace the Inactive to Active in the Patch Formula Conclusion: Hope above Blog helps you Activate, Deactivate multiple records of CDS from the Grid.
Share Story :
Required Privilege for Canvas App in D365 CRM
Introduction This blog explains how to resolve the issue for Canvas App not loading which is embedded in D365 CRM using HTML Webresource. Issue After Canvas App was published and shared with Users still, they were unable to access the Power App. It was showing a blank page with no error. Resolution After debugging the Webpage, I concluded it was missing the Canvas App required privilege. The privilege can be found in D365 CRM as per below screenshot After creating a new role for sharing Canvas App and assigning to User, Canvas App rendered as below Conclusion I hope the above Blog helps you resolve the issue for Canvas App embedded using HTML Webresource in D365 CRM. Note: This privilege is only required for Canvas App embedded with HTML Webresource in D365 CRM.
Share Story :
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.
Share Story :
Create Object Detection Model inside the Power Platform | Power Apps — AI Builder
In this blog, we are going to see how to create object detection model which can be used in PowerApps or MS Flow / PowerAutomate Step 1: Log in to portal.office.com. Select the PowerApps, If PowerApps is not visible then click on All Apps then you will able to see the PowerApps. Step 2: Expand the AI Builder Section and click on Build Section in PowerApps. Note: Please ensure that you are select the correct instance. Step 3: Click on the Object Detection Model We are going to create the Object Detection Model which can be used to created PowerApps or In MS Flow / Automate. Step 4: Name the AI Model and click on Create. Step 5: We will select the Domain of Model so we will go with Common Object. And click on Next. Step 6: Before moving forward, we will download the data which will be used to train and test the Model. Kaggle is the best source for the data to train the machine learning model. We will require the fruit images as we are designing the Fruit Detection Model, search fruit images and download the Dataset given in the screenshot. Select the Fruit Image for Object Detection Click on the Download Step 7: After downloading the Zip file extract it. You will see the following two folders — train_zip and test_zip respectively. Now, we will open the train_zip folder and you can see that there will be four categories of images Apple Banana Orange Mixed [Apple, Banana, Orange] Step 8: Let move back to the PowerApps Platform, 2nd step in the creation of Object Model is to define the object that we are going to detect. Here, we have three objects — Apple, Banana & Orange and click on next to move further steps. Step 9: We will require a minimum 15 images of each category to train our Object Detection Model. Now, we will click on Add Images and select Upload from local storage. Step 10: Select the images. Once all images are upload click on Close. Click on Next Step 11: Now, we are in the most important phase of the training where we provide the Tag or Label to the Images which we have uploaded. Click on the uploaded image and select the area where the object is present. Once you will select the area you will get the option to select the object is that present in the selection area. If an image is not suitable for the model to remove that particular image click on the “Don’t use Image ”. Click on remove to remove the image from the model data set. Step 12: Once you are done will the tagging or labeling the image click on the Done tagging. Note: Please ensure that you have a more tagged image for each model so that your model will work accurately. The more the label data more the accurate your machine learning model. Step 13: Click on the Train to start the training your model based on tagged images. Click on Go to Model It will take around 5–10 min to train based on your complexity of images, model and objects. Step 14: Publish the model. Once you model finished with done and you have published the Model. You can use that model to in Power App or MS Flow. We are going to see that in the next part of this blog.
Share Story :
Change the Position of Data Card on the Form in PowerApps.
Introduction: In this blog, we will learn how to set the position of Data Card in form. Steps: 1.This is the form of Quote Product. Where all the Data Card is placed one after another. 2.We want this card to be beside one another. 3.To achieve this, click on the Data Card and change X and Y property. 4.These are the X and Y of different Data Card. Conclusion: Hope the above Blog helps you to Change the Position of Data Card in Form.
Share Story :
Lookup Field with multiple search columns in PowerApps.
Introduction: In this blog, we will learn how to set multiple search fields in a Lookup Field. Use Case: We have a requirement where there is a Field (Data Field: Lookup) on the form, which should search records according to multiple columns. The Field on the Form is a Combo Box Steps: 1. This is the form of Quote Product. We want to allow searching based on multiple column. 2. To allow searching based on multiple fields, click on the Combo Box. Items property: Set ExistingProduct.Items = Sort( Filter( Filter( Data Source, Condition ), StartsWith( Text, SearchText ) Or StartsWith( Text, SearchText ) ), ColumnName ) For eg: ExistingProductQPEditForm_2.Items =Sort( Filter( Filter( [@Products], Status = ‘Status (Products)’.Active ), StartsWith( ‘Product Code’, ExistingProductQPEditForm_2.SearchText ) Or StartsWith( Name, ExistingProductQPEditForm_2.SearchText ) ), Name ) SearchFields property: Set ExistingProduct.SearchFields = { “ColumnName”, “ColumnName”} For eg: ExistingProductQPEditForm_2.SearchFields = {“cf_productcode”, “name”} Conclusion: Hope the above Blog helps you to search based on multiple columns for the Lookup field.
Share Story :
Updating multiple CDS records from Grid using PowerApps
Introduction: In this blog, we will learn how to Update multiple records of CDS from the Grid. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Save Icon on top of the Grid, it should Save every record which is selected through the checkbox which is there on every record of the Grid. Steps: 1. There is a Screen on which there is an Editable grid of Quote Product Entity. To Create an Editable Grid refer to the following link. https://www.cloudfronts.com/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.com/add-lookup-fields-in-an-editable-grid-using-powerapps/ 2. This is the grid with a checkbox. 3. To Save selected records, first create a Collection: OnSelect property of the Delete icon: Set SaveIcon.OnSelect = ClearCollect( <VariableName>, Filter( <GalleryName>.AllItems, <CheckBoxName>.Value = true ) ) For eg: SaveSelectedRecord.OnSelect= ClearCollect( SelectedQuoteProduct, Filter( GalleryQuoteProduct.AllItems, CheckboxQuoteProductGallery.Value = true ) ) 4. When we select the Save Icon, it will collect all the records where the Checkbox is selected. 5. To Save the records from the CDS, set the OnSelect property of the Save Icon to the following formula: OnSelect property of the Delete icon: Set SaveIcon.OnSelect = ForAll( <CollectionVariable>, Patch( ‘Gallery Data Source’, <GUID you want to delete> { <fieldName>: TextInput.Text, <fieldName>:ComboBoxName.Selected, <fieldName>:Value(CurrencyTextInput.Text) } ) ) For eg: SaveSelectedRecord.OnSelect=ForAll( SelectedQuoteProduct, Patch( [@’Quote Products’], LookUp( [@’Quote Products’], ‘Quote Product’ in SelectedQuoteProduct[@’Quote Product’] ), { ‘Product Code’: ProductCodeQPGallery.Text, ‘Product Name’: ProductNameQPGallery.Text, Quantity: Value(QuantityQPGallery.Text), ‘Sales Price’: Value(SoldPriceQPEditform.Text), ‘Discount Amount’: Value(DiscountAmountQPGallery.Text), Tax:Value(TaxQPEditForm.Text), ‘Extended Amount’: Value(ExtendedAmountQPGallery.Text) } ) ) 6. Combine the Whole formula in the OnSelect property of Save Icon : For eg: SaveSelectedRecord.OnSelect= ClearCollect( SelectedQuoteProduct, Filter( GalleryQuoteProduct.AllItems, CheckboxQuoteProductGallery.Value = true ) ) ForAll( SelectedQuoteProduct, Patch( [@’Quote Products’], LookUp( [@’Quote Products’], ‘Quote Product’ in SelectedQuoteProduct[@’Quote Product’] ), { ‘Product Code’: ProductCodeQPGallery.Text, ‘Product Name’: ProductNameQPGallery.Text, Quantity: Value(QuantityQPGallery.Text), ‘Sales Price’: Value(SoldPriceQPEditform.Text), ‘Discount Amount’: Value(DiscountAmountQPGallery.Text), Tax:Value(TaxQPEditForm.Text), ‘Extended Amount’: Value(ExtendedAmountQPGallery.Text) } ) ) Conclusion: Hope the above Blog helps you Save multiple records of CDS from the Grid.
Share Story :
How to Set Default value of Two Options on New form using PowerApps
Introduction: In this blog, we will learn how to set Default Value of Two Options on New Form. Use Case: We have a requirement where there is a Field(Data Field: Two Options) on the form, which should show “NO” as Default value. The Field on the Form is a Combo Box. Steps: 1. This is the form of Quote Product. We want to set Override Price as NO. 2. To set Default value of the field, click on the Combo Box. DefaultSelectedItems property: Set OverridePrices.DefaultSelectedItems = { Value: <Field Name>.No} For eg: OverridePricesComboBoxQPForm.DefaultSelectedItems = {Value: ‘Override Prices (Quote Products)’.No} Conclusion: Hope the above Blog helps you to set Default Value of Two Options on New Form.
Share Story :
Delete multiple CDS records from Grid using PowerApps.
Introduction: In this blog, we will learn how to Delete multiple records of CDS from the Grid. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Delete Icon on top of the Grid, it should delete every record which is selected through the checkbox which is there on every record of the Grid. Solution: Steps to be followed: 1. There is a Screen on which there a Editable grid of Quote Product Entity. To Create an Editable Grid refer to the following link. https://www.cloudfronts.com/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.com/add-lookup-fields-in-an-editable-grid-using-powerapps/ 2. This is the grid with a checkbox. 3. To delete selected records, first create a Collection: OnSelect property of the Delete icon: Set DeleteIcon.OnSelect = ClearCollect(<VariableName>,Filter(<GalleryName>.AllItems,<CheckBoxName>.Value = true )) For eg: DeleteSelectedRecord.OnSelect= ClearCollect(SelectedQuoteProductDelete,Filter(GalleryQuoteProduct.AllItems,CheckboxQuoteProductGallery.Value = true)) 4. When we select the Delete Icon, it will collect all the records where the Checkbox is selected. 5. To delete the records from the CDS, set the OnSelect property of the Delete Icon to the following formula: OnSelect property of the Delete icon: Set DeleteIcon.OnSelect = ForAll(<CollectionVariable>,RemoveIf(‘Gallery Data Source’,<GUID you want to delete>)) For eg: DeleteSelectedRecord.OnSelect = ForAll(SelectedQuoteProductDelete,RemoveIf( [@’Quote Products’], ‘Quote Product’ in SelectedQuoteProductDelete[@’Quote Product’] )) 6. Combine the Whole formula in the Set OnSelect property of Set DeleteIcon : For eg: DeleteSelectedRecord.OnSelect = ClearCollect(SelectedQuoteProductDelete,Filter(GalleryQuoteProduct.AllItems,CheckboxQuoteProductGallery.Value = true)); ForAll(SelectedQuoteProductDelete,RemoveIf([@’Quote Products’],’Quote Product’ in SelectedQuoteProductDelete[@’Quote Product’]) ) Conclusion: Hope above Blog helps you delete multiple records of CDS from the Grid.
Share Story :
Hide certain Field of the form depending on Security Role of the User using PowerApps.
Introduction: In this blog, we will learn how to hide fields from the form based on the Security Role of the Logged in User. Use Case: We have a requirement where there are some Fields in the form, which should be hidden to the users who does not have the Security Role as Manager. Steps: 1. This is the form of Quote Product. We want to hide the Price Overriden field from the form to certain Users. 2. To hide the field, click on the DataCard. Visible property of the DataCard: Set Price Overridden_DataCard.Visible = If(LookUp([@’Security Roles’],Name = “Manager”,Role) in Concat(LookUp([@Users],’Full Name’ = User().FullName).’Security Roles(systemuserroles_association)’,Role & “;”),true,false) Conclusion: Hope the above Blog helps you to hide fields from the form based on the Security Role of the Logged in User.