Hello, I have a SharePoint List called 'Visit' that records the Clinical Visits of workers at a site.
In my PowerApps Form that is supposed to create a New Visit record, I have 2 ComboBoxes: Labor Name and Labor_ID, both being Lookup Fields in the Visit list(the image is attached below).
If the name changes, the ID in the ComboBox below changes to the related ID and vice versa (if the ID changes the Labor Name in the ComboBox above changes to the related name).
*The problem is when I submit the form, all the form's data is successfully submitted to a new Visit Record in SP, except for the 2 ComboBoxes Labor & Labor ID; creating blank cells in the newly created record*
It did randomly submit on 2 occasions but that was it.
Labor Name ComboBox `OnChange`:
Set(varFromLaborList, false);
Set(var_Labor_Name, laborNameComboBox.Selected.Value);
Reset(laborIdComboBox);
Labor Name ComboBox `DefaultSelectedItems`:
[LookUp(Labor, Labor_ID = var_Labor_ID, 'Name (FirstName)')]
Labor_ID ComboBox `OnChange`:
Set(varFromLaborList, false);
Set(var_Labor_ID, Value(LaborIdComboBox.Selected.Value));
Reset(LaborNameComboBox);
Labor_ID ComboBox `DefaultSelectedItems`:
[LookUp(Labor, 'Name (FirstName)' =var_Labor_Name, Labor_ID)]
Finally OnSelect I just use SubmitForm(MyForm)
Hi,
Do your combos allow for multiple selection? Be aware of the of Selected (single select combos) and SelectedItems (multiple selection combos)
Hey thank you for trying to help. I checked but both ComboBoxes have 'SelectMultiple' set to false.
Set(varFromLaborList, false); Set(var_Labor_ID, Value(LaborIdComboBox.Selected.Value)); Reset(LaborNameComboBox);
You are creating new records, right? When you reset the combo you get
[LookUp(Labor, 'Name (FirstName)' =var_Labor_Name, Labor_ID)]
If the record doesn´t yet exist, what will that look return?
I tried removing
Reset(LaborNameComboBox);
and
Reset(laborIdComboBox);
from both OnChanges, as they're no longer needed and both comboboxes are still updating each other correctly. However, it is still submitting blanks to SP
What should it be? Mine says
laborIdComboBox.Selected
and
laborNameComboBox.Selected
for the Update Properties of the the Labor_ID ComboBox and the Labor Name ComboBox respectively
Hi @Joseph_Nasr ,
Your scenario is quite different from others. Do you have two LookUp columns in the Visit list, and both of them looking into the Labor list, Labor_Name and Labor_ID columns?
If so, please consider follow below steps:
1. Change Items of both the Combo boxes to the Visit list, and change display fields to respective columns.
2. DefaultSelectedItems of the two Combo boxes:
laborNameComboBox:
LookUp(Labor, Labor_ID = var_Labor_ID)
laborIdComboBox:
LookUp(Labor, 'Name (FirstName)' =var_Labor_Name)
3. Update of the two Combo boxes:
laborNameComboBox:
{
Id:laborNameComboBox.Selected.ID,
Value:laborNameComboBox.Selected.'Name (FirstName)'}
}
laborIdComboBox:
{
Id:laborIdComboBox.Selected.ID,
Value:laborIdomboBox.Selected.Labor_ID}
}
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hello, I'm trying out your solution right now.
Regarding Step 1: Items property of laborNameComboBox is already set to
Choices([@Visit].'Labor Name')
and the same is true for laborIdComboBox (with the respective column of course).
Regarding Step 3: What do you mean by Update of the 2 combo boxes. Do you mean the OnChange property of every Combo box, or is it the Update Property of their data cards??
Hi @Joseph_Nasr ,
It's the Update property of their Data Cards.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |