cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MarkWhitfield
Level: Powered On

sharepoint power app form saving over first item in list

hi everyone,

 

I have a sharepoint list with a custom power app form, when i try to create a new item, the first item in the list is updated with the content from the form. I am using some filters/lookups in the form so I am using the patch formula on the OnSave button as follows:

 

If(IsBlank(SharePointIntegration.Selected) ||IsError(SharePointIntegration.Selected),
Concurrent(
Patch('Establishment Control',Defaults('Establishment Control'),

{
cost_centre:{ValueSmiley Very HappyataCardValue2.Selected.Result},
dept:{ValueSmiley Very HappyataCardValue36.Selected.Result},
bud_hold:Value(DataCardValue57.Text),
exec_lead:Value(DataCardValue58.Text),
type_of_changeSmiley Very HappyataCardValue4.Selected,
position_number3:{ValueSmiley Very HappyataCardValue59.Selected.Result},
position_title:Value(DataCardValue60.Text),
position_grade:Value(DataCardValue61.Text),
position_FTE:Value(DataCardValue61.Text),
del_dateSmiley Very HappyataCardValue11.SelectedDate,
eff_dateSmiley Very HappyataCardValue12.SelectedDate,
coverfrom_dateSmiley Very HappyataCardValue14.SelectedDate,
coverto_dateSmiley Very HappyataCardValue15.SelectedDate,
newposfrom_dateSmiley Very HappyataCardValue16.SelectedDate,
newposto_dateSmiley Very HappyataCardValue17.SelectedDate,
newpos_gradeSmiley Very HappyataCardValue19.Selected,
newpos_FTE:Value(DataCardValue20.Text),
regrade_dateSmiley Very HappyataCardValue21.SelectedDate,
regrade_title:Value(DataCardValue22.Text),
regrade_gradeSmiley Very HappyataCardValue23.Selected,
regrade_FTE:Value(DataCardValue24.Text),
regrade_FTE_current:Value(DataCardValue25.Text),
financial_effectSmiley Very HappyataCardValue26.Selected,
funding_sourceSmiley Very HappyataCardValue27.Selected,
anti_part_year_change:Value(DataCardValue28.Text),
anti_full_year_change:Value(DataCardValue29.Text),
reason_for_change:Value(DataCardValue30.Text),
fin_conf_part_year_cost:Value(DataCardValue31.Text),
fin_conf_full_year_cost:Value(DataCardValue32.Text),
fin_newpos_costcentre:Value(DataCardValue33.Text),
fin_newpos_servline:Value(DataCardValue34.Text),
fin_newpos_subj2Smiley Very HappyataCardValue41.Selected,
fin_newpos_subcode2Smiley Very HappyataCardValue55.Selected,
fin_newpos_FTE:Value(DataCardValue37.Text),
fin_newpos_fromdateSmiley Very HappyataCardValue38.SelectedDate,
fin_newpos_todateSmiley Very HappyataCardValue35.SelectedDate,
fin_regrade_dateSmiley Very HappyataCardValue39.SelectedDate,
fin_regrade_FTE:Value(DataCardValue40.Text),
fin_regrade_subj2Smiley Very HappyataCardValue56.Selected,
fin_revised_FTE:Value(DataCardValue42.Text),
fin_approvedSmiley Very HappyataCardValue43.Selected,
fin_reject_reason:Value(DataCardValue44.Text),
fin_comments:Value(DataCardValue45.Text),
hr_afc_validSmiley Very HappyataCardValue46.Selected,
hr_org_contextSmiley Very HappyataCardValue47.Selected,
hr_supportSmiley Very HappyataCardValue48.Selected,
hr_reject_reason:Value(DataCardValue49.Text),
hr_budholder_matters:Value(DataCardValue50.Text),
hr_comments:Value(DataCardValue51.Text),
exec_supportSmiley Very HappyataCardValue52.Selected,
exec_reject:Value(DataCardValue53.Text),
exec_comments:Value(DataCardValue54.Text)
});
ResetForm(SharePointForm1),RequestHide()
)
,
Concurrent(
Patch('Establishment Control',SharePointIntegration.Selected,

{
cost_centre:{ValueSmiley Very HappyataCardValue2.Selected.Result},
dept:{ValueSmiley Very HappyataCardValue36.Selected.Result},
bud_hold:Value(DataCardValue57.Text),
exec_lead:Value(DataCardValue58.Text),
type_of_changeSmiley Very HappyataCardValue4.Selected,
position_number3:{ValueSmiley Very HappyataCardValue59.Selected.Result},
position_title:Value(DataCardValue60.Text),
position_grade:Value(DataCardValue61.Text),
position_FTE:Value(DataCardValue61.Text),
del_dateSmiley Very HappyataCardValue11.SelectedDate,
eff_dateSmiley Very HappyataCardValue12.SelectedDate,
coverfrom_dateSmiley Very HappyataCardValue14.SelectedDate,
coverto_dateSmiley Very HappyataCardValue15.SelectedDate,
newposfrom_dateSmiley Very HappyataCardValue16.SelectedDate,
newposto_dateSmiley Very HappyataCardValue17.SelectedDate,
newpos_gradeSmiley Very HappyataCardValue19.Selected,
newpos_FTE:Value(DataCardValue20.Text),
regrade_dateSmiley Very HappyataCardValue21.SelectedDate,
regrade_title:Value(DataCardValue22.Text),
regrade_gradeSmiley Very HappyataCardValue23.Selected,
regrade_FTE:Value(DataCardValue24.Text),
regrade_FTE_current:Value(DataCardValue25.Text),
financial_effectSmiley Very HappyataCardValue26.Selected,
funding_sourceSmiley Very HappyataCardValue27.Selected,
anti_part_year_change:Value(DataCardValue28.Text),
anti_full_year_change:Value(DataCardValue29.Text),
reason_for_change:Value(DataCardValue30.Text),
fin_conf_part_year_cost:Value(DataCardValue31.Text),
fin_conf_full_year_cost:Value(DataCardValue32.Text),
fin_newpos_costcentre:Value(DataCardValue33.Text),
fin_newpos_servline:Value(DataCardValue34.Text),
fin_newpos_subj2Smiley Very HappyataCardValue41.Selected,
fin_newpos_subcode2Smiley Very HappyataCardValue55.Selected,
fin_newpos_FTE:Value(DataCardValue37.Text),
fin_newpos_fromdateSmiley Very HappyataCardValue38.SelectedDate,
fin_newpos_todateSmiley Very HappyataCardValue35.SelectedDate,
fin_regrade_dateSmiley Very HappyataCardValue39.SelectedDate,
fin_regrade_FTE:Value(DataCardValue40.Text),
fin_regrade_subj2Smiley Very HappyataCardValue56.Selected,
fin_revised_FTE:Value(DataCardValue42.Text),
fin_approvedSmiley Very HappyataCardValue43.Selected,
fin_reject_reason:Value(DataCardValue44.Text),
fin_comments:Value(DataCardValue45.Text),
hr_afc_validSmiley Very HappyataCardValue46.Selected,
hr_org_contextSmiley Very HappyataCardValue47.Selected,
hr_supportSmiley Very HappyataCardValue48.Selected,
hr_reject_reason:Value(DataCardValue49.Text),
hr_budholder_matters:Value(DataCardValue50.Text),
hr_comments:Value(DataCardValue51.Text),
exec_supportSmiley Very HappyataCardValue52.Selected,
exec_reject:Value(DataCardValue53.Text),
exec_comments:Value(DataCardValue54.Text)
});
ResetForm(SharePointForm1),RequestHide()
)
)

 

 

Apologies for posting in full but i wanted to give as much information as possible on the issue. I have been able to use a similar function to this previously without issue, I have also reverted back to a previous version of the form and the issue persists. COuld anyone advise how this is happening? Is there another property in the form that i need up change?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: sharepoint power app form saving over first item in list

Try changing the first part of the If function:

 

From: IsBlank(SharePointIntegration.Selected) ||IsError(SharePointIntegration.Selected)

 

To: SharePointForm1.Mode = New



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
2 REPLIES 2
Super User
Super User

Re: sharepoint power app form saving over first item in list

Try changing the first part of the If function:

 

From: IsBlank(SharePointIntegration.Selected) ||IsError(SharePointIntegration.Selected)

 

To: SharePointForm1.Mode = New



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: sharepoint power app form saving over first item in list

Hi @MarkWhitfield ,

Do you custom a form using PowerApps within your SP List?

 

Please consider take a try to modify your formula as below:

If(
    IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),  /* <-- Modify your formula here */
    Patch(
'Establishment Control',
Defaults('Establishment Control'),
SharePointForm1.Updates /* <-- SharePointForm1 represents the Edit form in your app */
);ResetForm(SharePointForm1);RequestHide(),
Patch(
'Establishment Control',
SharePointIntegration.Selected,
SharePointForm1.Updates
);ResetForm(SharePointForm1),RequestHide() )

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

 

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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 229 members 5,079 guests
Please welcome our newest community members: