I'm customizing a SharePoint edit form with powerapps. When I open the record it displays the correct data in all the fields. I've added an additional dropdown field [SelectedDescription] that displays choices from another lookup list. I want to select an appropriate choice in that dropdown field and have it populate other text fields in the form already populated by its default value when opened.
My lookup list [Order Parts Lookup] has the following fields: Description, Part Number, and Master. The [SelectedDescription] dropdown pulls values from the Description column of OPL. I have all this working so far.
On a button push I want to replace the Description, Part Number, and Master text input field values on the form with that of the selection I have made in the dropdown field.
Form.Description = OPL.Description
Form.Part Number = OPL.Part Number
Form.Master = OPL.Master
I'm having trouble getting the input fields to populate with the lookup field data. On the [OnSelect] property of the button I have the following so far:
DataCardValue13.Text = SelectedDescription.Selected.Description
Hi @ShawnPelletier ,
You can use below formula to add blank value to dropdown -
Ungroup(Table({dropdownOptions : Table({Value: Blank()})}, {dropdownOptions : Distinct(LookUpList,Title)}),"dropdownOptions")
To set default value, you will have to use variables -
OnSelect property of button - UpdateContext({varPartNumber: LookUp(OPL, DescriptionDropdown.Selected.Value = Description, 'Part Number'), varMaster: LookUp(OPL, DescriptionDropdown.Selected.Value = Description, Master) })
Then you can use these variables in Default property of controls.
Assuming the variables will be used on a single screen.
I need it to happen on a button push otherwise the default values of my text fields will change automatically and not on demand or as needed. Also the Dropdown field I added always displays the first choice from the lookup list and I don't know how to set it to blank instead.
Hi @ShawnPelletier ,
WOuld you like to diplay Part Number and Master values based on selection of Description dropdown?
Try using below formula on respective fields -
1. Default property of control (DataCardValue..) which needs to display Part Number - LookUp(OPL, DescriptionDropdown.Selected.Value = Description, 'Part Number')
2. Default property of control (DataCardValue..) which needs to display Master - LookUp(OPL, DescriptionDropdown.Selected.Value = Description, Master)