PowerApps Archives - Page 5 of 5 - - Page 5

Category Archives: PowerApps

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.in/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.in/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.in/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.in/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.

Share Story :

Filter a Lookup Field on New Form Using PowerApps.

Introduction: In this blog, we will learn how to filter a Lookup Field on the New Form. Use Case: We have a requirement where there is a Lookup Field on the form, which should only show those values whose Status is Active. Steps: 1. This is the form of Quote Product. We want to filter the Existing Product field. 2. To filter the field, click on the Combo Box.         Items property:          Set ExistingProduct.Items =  Filter(<Data Source>,Status = <Field Name>.Active) For eg: ExistingProductQPEditForm.Items = Filter([@Products],Status = ‘Status (Products)’.Active)   Conclusion: Hope the above Blog helps you to filter a Lookup Field on the New Form.

Share Story :

Nested Filters in PowerApps.

Introduction: In this blog, we will learn how to use Nested filters in PowerApps. Use Case: We have a Gallery(GalleryQuoteLineDetail) where we need to put filter which equals Quote Product selected in another Gallery. Once we get those Quote Products, we need to filter the Gallery(GalleryQuoteLineDetail) based on ‘Transaction Type’ Field,  which is a field on Quote Product. The ‘Transaction Type’ should be equal to “Project Contract”. Solution: Steps to be followed: 1. Below is the CDS Data Source, we want to filter. 2. To filter the Gallery Based on another Gallery, Use the below Formula: Items property of Gallery:      Set: GalleryQuoteLineDetail.Items: Filter( ‘Data Source’,Condition)      For eg: GalleryQuoteLineDetail.Items : Filter(‘Quote Line Detail’,’Quote Line’.’Quote Product’ =  GalleryQuoteLine.Selected.’Quote Product’)   3. To filter the Gallery Based on “Transaction Type”, Transaction Type is of Option Set Data Type, Use the below Formula: Items property of Gallery:      Set: GalleryQuoteLineDetail.Items : Filter( ‘Quote Line Detail’,  ‘Transaction Type’ in “Project Contract” ) 4. To Combine both the Filters in a single Formula, use the first filter as ‘Data Source’ of the second filter: Following is the formula:  Filter( Filter (‘Quote Line Detail’, ‘Quote Line’.’Quote Product’ =  GalleryQuoteLine.Selected.’Quote Product’ ), ‘Transaction Type’ in “Project Contract” )   Conclusion: Hope this Blog helps you to combine multiple Filters into single Filter.

Share Story :

Multiple Ways to Share a Canvas App in PowerApps

Introduction :- This blog explains multiple options how to share a Canvas Apps in Power Apps. Steps :- Select App and click on Share option, below screenshot for reference   Options of Sharing Published App :- 1.  Specify each User by Name. Enter Username in sharing panel and click Share button App can be shared with other Users by checking the Checkbox for Co-owner.   2.  Specify that your entire Organization. Type Everyone in the sharing panel and select the option of Everyone of your organization. 3.  Specify a security group in Azure Active Directory. Select security group name in sharing panel Note :- You can’t share an app with a distribution group in your organization or with a group outside your organization. You can’t grant Co-owner permission to a security group if you created the app from within a solution. Tips :- Regardless of permissions, no two people can edit an app at the same time. If one person opens the app for editing, other people can run it but not edit it. Notify user for sharing app, select the Send an email invitation to new users check box.   Conclusion :- Hope above Blog helps you sharing designed Canvas App in Power Apps with Users as per business requirement.

Share Story :

Filter Gallery based on lookup field (Combo Box) on EditForm

Introduction: In this blog, we will learn how to filter Gallery based on Combo Box which is on different form.   Use Case: We have a requirement where there is a lookup field (Price List) on the Editform (Data Source: Quote Project Price List). When there is data in the lookup field the Gallery (Data Source: Role Price) should be filtered.   Steps: 1. We have an Screen which is divided into two parts:(Edit Form + Gallery)          a. Quote Project Price List Edit Form.          b. Gallery with Role Price data source. 2. Add field into the Editable Grid (Gallery). 3. The Lookup Field on the EditForm is PRICE LIST on which the gallery is suppose to be filtered. 4. To filter the Gallery set the Items property of the Gallery to the following formula, Item property: Set Gallery.Item = Filter(‘Gallery Data Source’, ‘GalleryFieldName’.Name = ‘Form Lookup Field Name(Combo Box)’.Selected.Name) For eg: GalleryRolePrice.Item=Filter(‘Role Prices’, ‘Price List’.Name=PriceListLookup.Selected.Name) 5. Output of the screen, The Gallery is not visible as the Lookup Field (Price List) is not selected. 6. After selecting the Lookup Field (Price List), the gallery is visible and also filtered on the basis of the selected field. 7. In this way the Gallery will get Filtered on the basis of the Lookup field on the EditForm.

Share Story :

Add lookup fields in an editable grid using PowerApps

Introduction: We had a requirement where we wanted to show the editable grid in power apps. The fields which are suppose to show are of string, decimal and lookup. Other data type was easy to display but we find difficulties in showing the lookup value.   In this blog, we will learn how to add lookup fields(combo box) into the editable grid and also save it in Dynamics 365 CRM.   Steps: 1. Insert Gallery :  Insert a new gallery – Insert > Gallery > Blank Vertical Add Data Source to the Gallery Go to Properties > Click Data Source you want. 2. Add Combo Box input control in the PowerApps Grid.     I have added 3 Combo Box input control inside the Grid, 2 text box, 1 is currency field in the data source and a Save icon. 3. For each Combo Box input box: Item Property: Set ComboBox.Item = Choices([@’Data Source’].<Field Name>) For eg: RoleComboBoxRP_1.Item = Choices([@’Role Prices’].Role) DefaultSelectedItems property: Set ComboBox.DefaultSelectedItems = ThisItem.<Field Name> For eg: RoleComboBoxRP_1.DefaultSelectedItems = ThisItem.Role 4. For each text input box: Default property: Set TextInput.Default = ThisItem.<Field Name> For eg: DescriptionRP_1.Default = ThisItem.Description Note: Do not forget to set the <DefaultSelectedItems> properties or else the value wont be visible in the grid. 5. To Save the changed value into the Data source, set the Save Icon to the following: OnChange property: Set SaveIcon.OnChange = Patch(DataSource, ThisItem, { <fieldName>: TextInput.Text, <fieldName>:ComboBoxName.Selected, <fieldName>:Value(CurrencyTextInput.Text) }) For eg: SaveRP_1.OnChange = Patch([@’Role Prices’], ThisItem, { Role : RoleComboBoxRP_1.Selected, ‘Resourcing Unit’:ResourcingUnitComboBoxRP_1.Selected, Unit:UnitComboBoxRP_1.Selected, Description:DescriptionRP_1.Text, Price:Value(PriceRP_1.Text) }) 6. The Output Screen. 7. The changed Lookup value. If you click the Save Icon the changed values will be saved. In this way we can change the Lookup values and also Save the changed value in the Dynamics 365 CRM.

Share Story :

SEARCH BLOGS:

[gravityform id="36" ajax="true"]

FOLLOW CLOUDFRONTS BLOG :