cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Error on Button while submitting Form

Hi Expert,

 

I am trying to follow Procedure mention in below Post to create "Visitor Managment App" but stuck in few area's and facing issue.

 

https://medium.com/dtlpub/using-office-365-powerapps-and-microsoft-flow-to-build-your-own-visitor-re...

 

 

I just developed three forms 1. Edit Form 2. Dashboard Screen

 

In a Edit Form we are unable to submit data on SharePoint List with a below mention code 

 

Patch(visitorRegistration, Defaults(visitorRegistration), {VisitorName: DataCardValue1.Text,Address: DataCardValue2.Text,OrganizationName: DataCardValue3.Text,
ContactNumber: DataCardValue4.Text,
ContactPerson: DataCardValue5.value,
Contactemail: DataCardValue6.value,
Reason: DataCardValue7.Text)};

 

Now i am want to understand is this above code is for submit button ?

What is the Data Type of Value for Person or Group ?

If Code for Submit button is not correct then which is the correct code for submit button as per requirement we have to send email with each submit.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Anonymous :

Let me answer your questions one by one.

Q1:Now i am want to understand is this above code is for submit button ?

Yes.But judging from your screenshot, this formula does not seem to be finished, so an error occurred.

Patch(visitorRegistration, Defaults(visitorRegistration), {VisitorName: DataCardValue1.Text,Address: DataCardValue2.Text,OrganizationName: DataCardValue3.Text,
ContactNumber: DataCardValue4.Text (In the screenshot, your formula seems to be interrupted here)

Q2:What is the Data Type of Value for Person or Group ?

If the column allow mutiple selection,it is a table:

[
{ 
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
  DisplayName:DisplayName,
  Claims:"i:0#.f|membership|" & EmailAdress,   
  Email:EmailAdress
}
]

 If the column do not allow mutiple selection,it is a record:

{ 
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
  DisplayName:DisplayName,
  Claims:"i:0#.f|membership|" & EmailAdress,   
  Email:EmailAdress
}

I think this link will help you a lot:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Person-column-and-SubmitForm/td-p/549235

Q3:If Code for Submit button is not correct then which is the correct code for submit button as per requirement we have to send email with each submit.

Because of the lack of information (List data structure, Form settings.......), I can not directly provide the correct code.

I suggest you follow the link you gave and replace Patch() with SubmitForm().

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @Anonymous :

Let me answer your questions one by one.

Q1:Now i am want to understand is this above code is for submit button ?

Yes.But judging from your screenshot, this formula does not seem to be finished, so an error occurred.

Patch(visitorRegistration, Defaults(visitorRegistration), {VisitorName: DataCardValue1.Text,Address: DataCardValue2.Text,OrganizationName: DataCardValue3.Text,
ContactNumber: DataCardValue4.Text (In the screenshot, your formula seems to be interrupted here)

Q2:What is the Data Type of Value for Person or Group ?

If the column allow mutiple selection,it is a table:

[
{ 
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
  DisplayName:DisplayName,
  Claims:"i:0#.f|membership|" & EmailAdress,   
  Email:EmailAdress
}
]

 If the column do not allow mutiple selection,it is a record:

{ 
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
  DisplayName:DisplayName,
  Claims:"i:0#.f|membership|" & EmailAdress,   
  Email:EmailAdress
}

I think this link will help you a lot:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Person-column-and-SubmitForm/td-p/549235

Q3:If Code for Submit button is not correct then which is the correct code for submit button as per requirement we have to send email with each submit.

Because of the lack of information (List data structure, Form settings.......), I can not directly provide the correct code.

I suggest you follow the link you gave and replace Patch() with SubmitForm().

Best Regards,

Bof

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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,130)