cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SteepM
Frequent Visitor

Inserting SQL row - increments the ID that I am parsing by random values

Hi,

I have a flow that from webhook json body, I extract values and want to insert row in SQL Server Database. I had many successful tries, but when I started setting up correct Keys and relations, I realized that the ID that I am parsing which is 15-16 digits number, is changed after it is Inserted as a Database row. 

So this is the flow: 

SteepM_0-1611072598132.png

SteepM_1-1611072680177.png


And this is the Input for ID from a recent Successful run:

SteepM_2-1611072862382.png

 

THIS IS THE OUTPUT OF ID AFTER INSERTION:

SteepM_3-1611072923702.png


As you can see only the last digit is changed. I tried so many things, and I can't think of any way to solve this. Also, on other Tables and other Flows, it is happening the same, the ID that I input is modified for + few digits. 

Please share any info, Thanks!

7 REPLIES 7
Pstork1
Dual Super User
Dual Super User

What is the definition of the column in SQL?  Is this an Identity column in SQL?  If it is then SQL will generate a new number to make sure its unique.  For this to work correctly the column needs to be a Nvarchar column.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
SteepM
Frequent Visitor

It is the PK Column named ID as a bigint. 

I changed it to nvarchar column as you mentioned but still did the same thing.
INPUT:

SteepM_0-1611073778764.png

OUTPUT:

SteepM_1-1611073819013.png

 



Pstork1
Dual Super User
Dual Super User

I don't think you will be able to set the Primary Key for a record in a table.  What you want is a Foreign key to an external table.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
SteepM
Frequent Visitor

Then what is the usual way of inserting a row and keeping track of the ID? 

In the Insert a Row flow, this is a required field. .


SteepM_0-1611114626615.png

 

So I need to provide an ID, but then how would I keep track of the right Primary ID/key when the one that I am providing is being modified after insertion in a very weird way, only the last two/three digits are modified from a 16 digit number.


SteepM
Frequent Visitor

I also tried:

 

Updated the PK to Identity Column

Applied set identity insert to ON as explained in the docs. 

I now tried to insert a row with an ID: 9497000000553110

 

From the output: The returned row after insertion now has ID: 9497000000553111

 

 

 

Szabi1983
New Member

Have the exact same problem! Has anything changed so far?

SteepM
Frequent Visitor

Not that I know of. It's really weird for me, and please if you get it working let me know on this topic.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,953)