Hey PowerApp peeps,
Hoping someone can help me with two issues.
I have an edit form connected to a SharePoint List called "Hazard Assessments".
Within one of my data cards is a vertical gallery (Gallery_Hazard) that has a combo box (ComboBox_PickHzd), a text input control (TextInput_AddPlantoElim), and save button (Icon_Save).
The user will select a choice from ComboBox then they write a blurb in the TextInput. When they push the Icon_Save it adds both items to a collection (colEliminate) and creates a new record within the gallery.
My ComboBox Items property is set to the following to allow my user to add a custom choice into the ComboBox.
Ungroup(Table({DropDownOptions: Choices([@'Hazard Assessment'].PreLoaded_Hazards0)}, {DropDownOptions: ["➕ Other"]}),"DropDownOptions").
Gallery Items property: colHazards
Icon_Save OnSelect property: ClearCollect(colEliminate, ThisItem, {Hazards: Label2.Text, Eliminate: TextInput_AddPlanToElim.Text}); Collect(colHazards, varNewRecord)
I should mention the Label2 in the above formula is referencing a text label that pulls the info from the ComboBox selection or the custom value they have added (depending on if they add a new choice or select from the list).
The formula is: If(ComboBox_PickHzd.Selected.Value = "➕ Other", TextInput_Add_Hazard.Text, ComboBox_PickHzd.Selected.Value)
colHazards has one column set to "Value"
colEliminate has two columns set to "Hazards" & "Eliminate"
First Issue:
I want the ComboBox DefaultSelectedItem to be the Parent.Default (set in my SharePoint list) but only if hasn't been added to the collection already. Otherwise I don't want it to select a default.
Second Issue:
This may be solved by the above issue, but if the DefaultSelectedItem referenced above is automatically selected, I want a specific text to be automatically filled into the text input. Otherwise, I want it to remain blank.
I've been able to make some formula's sort of work, but they're either glitchy or they don't apply to all the items in the gallery.
Hopefully someone has an idea to help me.
Thanks in advance!