cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jonj25
Regular Visitor

Sharepoint customised forms - data being overridden when using multiple forms

Hi

 

I'm new to power apps and have been watching various videos on how to set up multiple forms to feedback to SharePoint. 

 

The problem I am having is randomly the data entries are overriding each other in sharepint and I can't pinpoint if this is in edit mode or when saving. it always seems to be the previous entry I was in. I'm using the below formula for onsave. what am i doing wrong?

 

If(
Form1.Mode=FormMode.New,
Patch(
'AAT Apprentice Tracker',
Defaults('AAT Apprentice Tracker'),
Form1.Updates,
Form2.Updates,
Form3.Updates
),
Patch(
'AAT Apprentice Tracker',
{ID: SharePointIntegration.SelectedListItemID},
Form1.Updates,
Form2.Updates,
Form3.Updates
)
);RequestHide()

 

my on edit formula is EditForm(Form1);EditForm(Form2);EditForm(Form3). 

 

 

3 REPLIES 3
BCLS776
Super User
Super User

If you are using form controls, you should be using SubmitForm() to save back to the list unless you have no other choice than to use Patch(). SubmitForm() offers more functionality, such as activating the OnSubmit & OnError properties of the form control.

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
jonj25
Regular Visitor

Hi,

 

i've used that before and had inconsistencies with the data saving across the three forms I have created. just tested it now on a new entry and the first two forms saved, but the third didnt. upon editing the entry the third form updated.

 

Am i missing something obvious?

 

jonj25_0-1633380705322.png

 

BCLS776
Super User
Super User

I haven't tried handling three forms at once through a Sharepoint integration like that.

 

Does your UX always involve submitting all three forms together? If so, I would try putting SubmitForm(Form2) in the OnSuccess of Form1 and SubmitForm(Form3) in the OnSuccess of Form2. That gives you the ability to add a bit of troubleshooting code like a Notify(), Errors(), or variable change that could help nail down what's happening here. As well, ensuring the SubmitForm() calls operate sequentially will help avoid any backend errors that come up when accessing the same record at nearly the same time with two function calls.

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,146)