cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KimberlyM
Helper IV
Helper IV

New form not submitting all data (but edit form will)

I am having issues getting my new form to submit all my data in my form. Some data will submit but my AssignedTo and 4 LeadMember dropdown boxes will not (LeadMember1, LeadMember2, LeadMember3, LeadMember4). Here is my code on my submit button.

SubmitForm(NewForm);

//SEND MAIL START

ClearCollect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember1.Selected.FullName, EmailAddressCC)}); 
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember2.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember3.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember4.Selected.FullName, EmailAddressCC)});

Office365.SendEmailV2(LookUp(Agents, FullName = ndd_AssignedTo.Selected.FullName, EmailAddressT), 
//Subject Line 
ndd_AssignedTo.SelectedText.Value & ", you have a new lead!", 
//Message Line 
"<strong>Name: </strong>" & ntxt_FirstName & " " & ntxt_LastName
& "<br><strong>Email: </strong>" & ntxt_Email
& "<br><strong>Phone: </strong>" & ntxt_Phone 
& "<br><strong>Address: </strong>" & ntxt_Unit & ", " & ntxt_Street & ", " & ntxt_City & ", " & ntxt_Province 
& "<br><strong>Listing Information: </strong>" & ndd_ListingType.Selected.Value & ", " & ndd_PropertyType.Selected.Value & ", " & ndd_Location.Selected.Value

& "<br><br><i>Source: " & ndd_Source.Selected.Value & "</i>", 
{Cc: Concat(ccEmails,Mail,";")}
);

//NAVIGATE AND RESET THE NEW FORM
Navigate( Dashboard, ScreenTransition.Fade ); ResetForm(NewForm);

I was using the same patch on the new button as seen in the edit screen code below but it kept making a second entry in my SharePoint table and still not patching the AssignedTo or LeadMember choice selections to the SharePoint list.

This is my code on my edit button. It will submit all my data in my form including the problem area on the New Form of the AssignedTo dropdown and the 4 LeadMember dropdown choices.

SubmitForm(EditForm);

Patch(Lead_Data,CurrentSelectedItem, { 
    //AssignedTo Dropdowns
    AssignedTo: {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_AssignedTo.SelectedText.Value
        }, 
    LeadMember1: {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember1.SelectedText.Value
        }, 
    LeadMember2: {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember2.SelectedText.Value
        }, 
    LeadMember3: {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember3.SelectedText.Value
        }, 
    LeadMember4: {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember4.SelectedText.Value
        }
});

//SEND MAIL START

ClearCollect(ccEmails,{Mail: LookUp(Agents, FullName = dd_LeadMember1.Selected.FullName, EmailAddressCC)}); 
Collect(ccEmails,{Mail: LookUp(Agents, FullName = dd_LeadMember2.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = dd_LeadMember3.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = dd_LeadMember4.Selected.FullName, EmailAddressCC)});

Office365.SendEmailV2(LookUp(Agents, FullName = dd_AssignedTo.Selected.FullName, EmailAddressT), 
//Subject Line 
dd_AssignedTo.SelectedText.Value & ", your lead has been udpated!", 
//Message Line 
"<strong>Name: </strong>" & txt_FirstName & " " & txt_LastName
& "<br><strong>Email: </strong>" & txt_Email
& "<br><strong>Phone: </strong>" & txt_Phone
& "<br><strong>Address: </strong>" & txt_Unit & ", " & txt_Street & ", " & txt_City & ", " & txt_Province
& "<br><strong>Listing Information: </strong>" & dd_ListingType.Selected.Value & ", " & dd_PropertyType.Selected.Value & ", " & dd_Location.Selected.Value  
& "<br><br><i>Source: " & dd_Source.Selected.Value & "</i>", 
{Cc: Concat(ccEmails,Mail,";")} 
);

//SEND MAIL END

Navigate( Dashboard, ScreenTransition.Fade )


I have had no luck over the past 2 weeks in trying to solve this. Can anyone help please? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @KimberlyM ,

Could you tell me why you need to add a patch function after submitform function when editing the record?

Actually, you do not need to.

You just need to set these datacards' Update property, then just need a submitform will be ok.

Are AssignedTo or LeadMember  drop downs inside the form?

If the controls are inside the form, the data in it will become invalid after you submit the form.

I assume that these 5 drop downs are inside the form.

If so, please set AssignedTo datacard's Update:

{  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_AssignedTo.SelectedText.Value
        }

set LeadMember1 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember1.SelectedText.Value
        }

set LeadMembe2 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember2.SelectedText.Value
        }

 

set LeadMember3 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember3.SelectedText.Value
        }

set LeadMember4 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember4.SelectedText.Value
        }

Then both new form and edit form use the same formula:

ClearCollect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember1.Selected.FullName, EmailAddressCC)}); 
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember2.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember3.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember4.Selected.FullName, EmailAddressCC)});

Office365.SendEmailV2(LookUp(Agents, FullName = ndd_AssignedTo.Selected.FullName, EmailAddressT), 
ndd_AssignedTo.SelectedText.Value & ", you have a new lead!", 
"<strong>Name: </strong>" & ntxt_FirstName & " " & ntxt_LastName
& "<br><strong>Email: </strong>" & ntxt_Email
& "<br><strong>Phone: </strong>" & ntxt_Phone 
& "<br><strong>Address: </strong>" & ntxt_Unit & ", " & ntxt_Street & ", " & ntxt_City & ", " & ntxt_Province 
& "<br><strong>Listing Information: </strong>" & ndd_ListingType.Selected.Value & ", " & ndd_PropertyType.Selected.Value & ", " & ndd_Location.Selected.Value
& "<br><br><i>Source: " & ndd_Source.Selected.Value & "</i>", 
{Cc: Concat(ccEmails,Mail,";")}
);
SubmitForm(Form Name); // if you firstly submit the form, all the data inside the form will become invalid Navigate( Dashboard, ScreenTransition.Fade ); ResetForm(FormName) 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @KimberlyM ,

Could you tell me why you need to add a patch function after submitform function when editing the record?

Actually, you do not need to.

You just need to set these datacards' Update property, then just need a submitform will be ok.

Are AssignedTo or LeadMember  drop downs inside the form?

If the controls are inside the form, the data in it will become invalid after you submit the form.

I assume that these 5 drop downs are inside the form.

If so, please set AssignedTo datacard's Update:

{  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_AssignedTo.SelectedText.Value
        }

set LeadMember1 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember1.SelectedText.Value
        }

set LeadMembe2 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember2.SelectedText.Value
        }

 

set LeadMember3 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember3.SelectedText.Value
        }

set LeadMember4 datacard's Update:

 {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",  
        Id: 0,  
        Value: dd_LeadMember4.SelectedText.Value
        }

Then both new form and edit form use the same formula:

ClearCollect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember1.Selected.FullName, EmailAddressCC)}); 
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember2.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember3.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember4.Selected.FullName, EmailAddressCC)});

Office365.SendEmailV2(LookUp(Agents, FullName = ndd_AssignedTo.Selected.FullName, EmailAddressT), 
ndd_AssignedTo.SelectedText.Value & ", you have a new lead!", 
"<strong>Name: </strong>" & ntxt_FirstName & " " & ntxt_LastName
& "<br><strong>Email: </strong>" & ntxt_Email
& "<br><strong>Phone: </strong>" & ntxt_Phone 
& "<br><strong>Address: </strong>" & ntxt_Unit & ", " & ntxt_Street & ", " & ntxt_City & ", " & ntxt_Province 
& "<br><strong>Listing Information: </strong>" & ndd_ListingType.Selected.Value & ", " & ndd_PropertyType.Selected.Value & ", " & ndd_Location.Selected.Value
& "<br><br><i>Source: " & ndd_Source.Selected.Value & "</i>", 
{Cc: Concat(ccEmails,Mail,";")}
);
SubmitForm(Form Name); // if you firstly submit the form, all the data inside the form will become invalid Navigate( Dashboard, ScreenTransition.Fade ); ResetForm(FormName) 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-yutliu-msft thank you! I never thought about setting the datacard's update. I have learned something big today so again, thank you for taking time out to help me! Also I did not know that using submit at the beginning would make my data invalid so that was huge too! All my data is displaying and submitting so nicely, as I want it too now. Smiley Very Happy

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,332)