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.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (4,261)