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

UpdateIf stuck in infinite load, but also works?

I'm updating an SQL Server table and a duplicate collection of that table in one button. When I press it, the app is stuck in an infinite loop with the dots passing the top of the screen and the button remains grey. I tested the UpdateIf functions for the SQL and Collection independently and the collection update works without issue. When I restart the app it shows that my SQL update went through, so the SQL part apparently worked, but is causing an infinite load. The table and collection are ~4,500 records long each. Below is the logic.

UpdateIf(
    '[dbo].[SQL_TABLE]',
    TABLE_ID in TableCheckedItems.TABLE_ID,
    {FOREIGN_KEY_ID: ComboBox27_1.Selected.FOREIGN_KEY_ID}
);
UpdateIf(
    SQL_TABLE_COLLECTION,
    TABLE_ID in TableCheckedItems.TABLE_ID,
    {FOREIGN_KEY_ID: ComboBox27_1.Selected.FOREIGN_KEY_ID}
)

 

2 REPLIES 2
Super User
Super User

Re: UpdateIf stuck in infinite load, but also works?

I am not sure why it would bestuck in a loop. Try adding your updateif() functions to a Concurrent(). If it works it will also improve performance.

 

Example 

Concurrent(
 UpdateIf(
    '[dbo].[SQL_TABLE]',
    TABLE_ID in TableCheckedItems.TABLE_ID,
    {FOREIGN_KEY_ID: ComboBox27_1.Selected.FOREIGN_KEY_ID}
 ),
 UpdateIf(
    SQL_TABLE_COLLECTION,
    TABLE_ID in TableCheckedItems.TABLE_ID,
    {FOREIGN_KEY_ID: ComboBox27_1.Selected.FOREIGN_KEY_ID}
 )
)

 

Formula1, Formula2 [, ...] )



--------------------------------------------------------------------------------
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.
epiej
Level: Powered On

Re: UpdateIf stuck in infinite load, but also works?

@Jeff_Thorpe I'd already tested both updates independently and narrowed it down to the SQL update causing the issue. I tried your solution, and while the collection is updated immediately, the loop is still there.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 121 members 3,574 guests
Please welcome our newest community members: