cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarrinerDev
Helper I
Helper I

LookUp after Patch (creating a new record) returns incomplete record for SQL

After calling a Stored Procedure (via PowerAutomate) to create a new record in an Azure SQL, I check that the return is successful and if so, I call LookUp() to retrieve the newly created record.

 

This all works fine except that the record returned by LookUp() doesn't return all the columns in the row. It returns a record, but only with 4 columns, not the 9 it should have. Paraphrasing, I do something like this:

 

Set( tmpNewRecordID , SPU_CreateRecord.Run( A, B, C));

If ( tmpNewRecordID > 0,

  Set( gCurrentRecord, LookUp( Records, pkRecord = tmpNewRecordID ));

 

The record returned by the LookUp() only has 4 columns (A,B,F,G) but it should have 9. The other 5 coluns are populated by the stored procedure. I even inserted a Refresh(Records) statement between the Stored Proc run and the LookUp() statement and this resulted in 5 columns being returned, but not the full 9. Note that the same LookUp() works properly once we navigate away from this screen and run the LookUp() again on another screen.

 

Strangely, for one of the missing columns, the PowerApps Studio variable inspector reports a blank value, even though a text label is reporting its value correctly. For another missing column, a text label reports blank as does the Studio.

 

Is this a timing issue? Or a bug with the Flow/SQL connectors...

 

Thankyou.

 

EDIT: After a lot of research on other sites, I can confirm this is a bug with PowerApps/SQL Connector interaction. It was reported at least as early as 2018 by @Meneghino on his blog. It's particularly evident when there is a column of type "Date" in the SQL table. Please fix it Microsoft.

2 REPLIES 2
StalinPonnusamy
Community Champion
Community Champion

Hi @MarrinerDev 

 

  • Can you explain when the Power Automate will be triggered?
    • Are we creating a new record on another table when powerapps updates on one table?
  • For powerapps, What is your datasource?

 

The PowerAutomate Flow to call the Stored Proc is triggered manually on a button click by the user to create a new record. It works fine and the the row in the table is created as expected.

The Stored Proc creates a new row in one table only. The data source is Azure SQL which is accessed via the Microsoft SQL Server Connector.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,563)