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

If statement with Patch/IfUpdate to SharePoint list issues

I have an button containing an If statement conaining both Patch/UpdateIf functions to create or update items in a SharePoint list.
 
Example: (I do have more columns than this)
Refresh('Sharepoint List');
If(IsBlank(
LookUp(
'Sharepoint List',
Column1 = DataCardValue1.Text && Column2 = DataCardValue2.Text,
false
)
),
Patch(
'Sharepoint List',
{
Column1: DataCardValue1.Text,
Column2: DataCardValue2.Text,
Column3: DataCardValue3.Selected,
Column4: DataCardValue4.Selected
}
),
UpdateIf(
'Sharepoint List',
Column1 = DataCardValue1.Text && Column2 = DataCardValue2.Text,
{
Column3: DataCardValue3.Selected,
Column4: DataCardValue4.Selected
}
)
)
This "works", however there are issues. The first time I select the button a new entry is created in the SharePoint list, as it should. The second time I select the button, instead of updating the previous entry, another new entry is created. When I select the button a third time BOTH entries are updated. Selecting the button a fouth time triggers an EATG Missmatch error.
 
If I press the button once, exit the app and go back in, everything works as it should
 
I am able to reproduce this over and over. 
 
I am not sure the reason for this behavior. Any help is appreciated.
Thank you.
 
 

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: 241 members 5,210 guests
Please welcome our newest community members: