cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joseph_Nasr
Helper I
Helper I

Form Fields Being Submitted as Blank/Empty Fields to Sharepoint List

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).

Pic 1.PNG

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*

Capture.PNG

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)

13 REPLIES 13
jcfDaniel
Super User
Super User

Hi,

 

Do your combos allow for multiple selection? Be aware of the of Selected (single select combos) and SelectedItems (multiple selection combos)


Regards. JD.

Hey thank you for trying to help. I checked but both ComboBoxes have 'SelectMultiple' set to false.

jcfDaniel
Super User
Super User

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?


Regards. JD.

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

Drrickryp
Super User
Super User

@Joseph_Nasr 

Check the Update property of the cards containing the comboboxes.

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,904)