cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianCCampbell
Resolver I
Resolver I

SQL Insert Row (V2) and dealing with identity column?

I have a Power Automate that is configured to connect to an Azure SQL DB. The Power Automate UI is exposing all the column names in the table. I have all of the columns set to NOT NULL and as such, there is an Asterisk in the Power Automate UI indicating as such. I have specified either a dynamic value or static value (all using the correct data types) except for the column that is the Primary Key. This column is set to auto-increment and as such should not have a value, but Power Automate won't let me leave it blank (because it is the Primary Key and NOT NULL). What is the appropriate value to specify for this auto-increment key in Power Automate? I know if I was inserting a row through PowerApps with a Patch statement I would just specify "Default(TableName)" to indicate it should create a new row with the default values (and sets the primary key),  but I don't see anything akin to that in the choices. 

I found one post that kind of looked similar but that answer didn't work for me. It was to specify this: items?['ColumnName'] as the value. It errored and reported that the insert with that value was submitted as NULL.

 

Thanks,

Brian

1 ACCEPTED SOLUTION

Accepted Solutions
BrianCCampbell
Resolver I
Resolver I

I found my problem. The Power Automate UI wasn't showing me the Primary (Auto-Increment) Key - it was showing a foreign key that I have in that table. Once I supplied a value and tested I received a Foreign Key Constraint error which helped me realize my error.

View solution in original post

1 REPLY 1
BrianCCampbell
Resolver I
Resolver I

I found my problem. The Power Automate UI wasn't showing me the Primary (Auto-Increment) Key - it was showing a foreign key that I have in that table. Once I supplied a value and tested I received a Foreign Key Constraint error which helped me realize my error.

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (913)