cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gazzo1967
Level 8

Duplicate Entries on Sharepoint Lists with Patch

Hi Guys

Need some help as i can't understand this one!

 

I have a Patch/Submitform which is entering data to 7 sharepoint Lists.

When i apply my patch 4 lists will create the correct single entries but 3 
TFDP_RTC

TFDP_9m_Ladder
TFDP_Pumping

Are creating duplicate ones!Capture.JPG

These are new records each time as the powerapp is to populate all the lists with the same  data in 4 fields

title

Person combo

single line text

Date picker

 

All fields in the sharepoint lists are set correctly as they are duplicated.

 

I have tried the below formula with and without DEFAULTS and still with the same outcome!

i also have autodisableonselect=true

Thanks for any help 🙂

Gary

 

 

Patch('TFDP_9m_Ladder',
Defaults('TFDP_9m_Ladder'),
{
Title:roll.Text,
TraineeName:name.Selected,
CourseNumber:coursenumber.Text,
CourseDate:coursedate.SelectedDate
});
Patch(TFDP_BA_Entry_Control,
Defaults(TFDP_BA_Entry_Control),
{
Title:roll.Text,
TraineeName:name.Selected,
CourseNumber:coursenumber.Text,
CourseDate:coursedate.SelectedDate
});
Patch(TFDP_BA_Tac_Vent,
Defaults(TFDP_BA_Tac_Vent),
{
Title:roll.Text,
TraineeName:name.Selected,
CourseNumber:coursenumber.Text,
CourseDate:coursedate.SelectedDate
});
Patch('TFDP_Pumping',
Defaults('TFDP_Pumping'),
{
Title:roll.Text,
TraineeName:name.Selected,
CourseNumber:coursenumber.Text,
CourseDate:coursedate.SelectedDate
});
Patch('TFDP_BA_Set_Check',
Defaults('TFDP_BA_Set_Check'),
{
Title:roll.Text,
TraineeName:name.Selected,
CourseNumber:coursenumber.Text,
CourseDate:coursedate.SelectedDate
});
Patch('TFDP_RTC',
Defaults('TFDP_RTC'),
{
Title:roll.Text,
TraineeName:name.Selected,
CourseNumber:coursenumber.Text,
CourseDate:coursedate.SelectedDate
});
SubmitForm(Form1_1)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Duplicate Entries on Sharepoint Lists with Patch

Hi @gazzo1967 ,

Does the Form1_1 connect to your 7th SP List?

Do you add other Patch formulas within the OnSuccess property of the Form1_1 to save data back to your three issue SP Lists?

Further, have you defined a MS Flow to create same record in another SP List when a new record is created in a SP List?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider remove the SubmitForm(...) formula from your above formulas, then execute these Patch formulas, then check if the issue is also occured.

 

Please consider take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

SubmitForm(Form1_1)

Set the OnSuccess property of the Form1_1 to following:

Patch(
'TFDP_9m_Ladder',
Defaults('TFDP_9m_Ladder'),
{
Title: Form1_1.LastSubmit.Title,
TraineeName: Form1_1.LastSubmit.TraineeName,
CourseNumber: Form1_1.LastSubmit.CourseName,
CourseDate: Form1_1.LastSubmit.CourseDate
}
);
Patch(
TFDP_BA_Entry_Control,
Defaults(TFDP_BA_Entry_Control),
{
Title: Form1_1.LastSubmit.Title,
TraineeName: Form1_1.LastSubmit.TraineeName,
CourseNumber: Form1_1.LastSubmit.CourseName,
CourseDate: Form1_1.LastSubmit.CourseDate
}
);
...
...;
Patch(
'TFDP_RTC',
Defaults('TFDP_RTC'),
{
Title: Form1_1.LastSubmit.Title,
TraineeName: Form1_1.LastSubmit.TraineeName,
CourseNumber: Form1_1.LastSubmit.CourseName,
CourseDate: Form1_1.LastSubmit.CourseDate
}
);

Please take a try with above solution, then check if the issue is solved.

 

Please make sure that the SubmitForm(...) formula would not affect additional SP List data sources. Also please make sure you do not define a MS Flow on your side to sync data from one SP list to another one (create same record in another SP list when a new record is created in one SP List).

 

Best regards,

Community Support Team _ Kris Dai
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

3 REPLIES 3
Super User
Super User

Re: Duplicate Entries on Sharepoint Lists with Patch

Hi,

 

If you are using Patch, try not to use SubmitForm unless it's unrelated, as things can get confusing that way, because patch and submitForm could both be writing to the same datasource.

 

Could you try do all of it with a Patch function and not use submitForm? Then have your button's OnSelect navigate them away from the screen and reset the form.

 

Let me know if you run into any other issues,

 

Cheers,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
Community Support Team
Community Support Team

Re: Duplicate Entries on Sharepoint Lists with Patch

Hi @gazzo1967 ,

Does the Form1_1 connect to your 7th SP List?

Do you add other Patch formulas within the OnSuccess property of the Form1_1 to save data back to your three issue SP Lists?

Further, have you defined a MS Flow to create same record in another SP List when a new record is created in a SP List?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider remove the SubmitForm(...) formula from your above formulas, then execute these Patch formulas, then check if the issue is also occured.

 

Please consider take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

SubmitForm(Form1_1)

Set the OnSuccess property of the Form1_1 to following:

Patch(
'TFDP_9m_Ladder',
Defaults('TFDP_9m_Ladder'),
{
Title: Form1_1.LastSubmit.Title,
TraineeName: Form1_1.LastSubmit.TraineeName,
CourseNumber: Form1_1.LastSubmit.CourseName,
CourseDate: Form1_1.LastSubmit.CourseDate
}
);
Patch(
TFDP_BA_Entry_Control,
Defaults(TFDP_BA_Entry_Control),
{
Title: Form1_1.LastSubmit.Title,
TraineeName: Form1_1.LastSubmit.TraineeName,
CourseNumber: Form1_1.LastSubmit.CourseName,
CourseDate: Form1_1.LastSubmit.CourseDate
}
);
...
...;
Patch(
'TFDP_RTC',
Defaults('TFDP_RTC'),
{
Title: Form1_1.LastSubmit.Title,
TraineeName: Form1_1.LastSubmit.TraineeName,
CourseNumber: Form1_1.LastSubmit.CourseName,
CourseDate: Form1_1.LastSubmit.CourseDate
}
);

Please take a try with above solution, then check if the issue is solved.

 

Please make sure that the SubmitForm(...) formula would not affect additional SP List data sources. Also please make sure you do not define a MS Flow on your side to sync data from one SP list to another one (create same record in another SP list when a new record is created in one SP List).

 

Best regards,

Community Support Team _ Kris Dai
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

gazzo1967
Level 8

Re: Duplicate Entries on Sharepoint Lists with Patch

@v-xida-msft 

this has cured it thank you 🙂

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,259)