cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

[Error] The key didn't match any rows in the table. Inner exception: The key didn't match any rows in the table.

Hey,

I have another problem in one of my Powerapps.

I tried to upload a collection to a SQL-Server but a strange error occurred.

Please take a look on the picture:2019-10-01 09_13_50-ONCR - Saved (Unpublished) - PowerApps.png

To make the SLQ-table I used the following code:

create table ONCR.Position(
	MachineCommissionNo nvarchar(255),
	MachineAbbreviation nvarchar(255),
	ArticleDescription nvarchar (255),
	ArticleNo nvarchar(255),
	SerialNo nvarchar(255),
	IndividualFaultDescription nvarchar(255),
	AdditionalFaultDescription nvarchar(255),
	CustomerRequest nvarchar(255),
	InternalProcedure nvarchar(255),
	FaultGroup nvarchar(255),
	Fault nvarchar(255),
	MachineStop nvarchar(255),
	Quantity nvarchar (100),
	HeaderGUID uniqueidentifier,
	GUID uniqueidentifier
	Constraint PK_Position primary key (GUID)
	Constraint FK_Head foreign key (HeaderGUID) REFERENCES ONCR.Head (GUID)
)

To make the Collection I used the following statement:

Collect
    (
      PosCache,
        {
            ArticleNo: input_articlenum.Text,
            ArticleDescription: input_articlename.Text,
            Quantity: input_quantity.Text,
            MachineCommissionNo: input_machinecomnum.Text,
            MachineAbbreviation: input_machineabb.Text,
            MachineStop: Text(toggle_machinestop.Value),
            InternalProcedure: dropdown_internalprocedure.Selected.Value,
            HeaderGUID: Text(header_guid),
            GUID: GUID()
        }
    );

To upload the data to the SQL-table I just used a simple Collect statement.

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper II
Helper II

Re: [Error] The key didn't match any rows in the table. Inner exception: The key didn't match any rows in the table.

I solved it on my own.
I had to change the order of the uploads to the SQL-Server.

I have to upload the positions collection before the head collection.

        Collect('[ONCR].[Position]', PosCache);
        Collect('[ONCR].[Head]', HeadCache);
        Collect('[ONCR].[feedback]_1', feedback);

View solution in original post

1 REPLY 1
Highlighted
Helper II
Helper II

Re: [Error] The key didn't match any rows in the table. Inner exception: The key didn't match any rows in the table.

I solved it on my own.
I had to change the order of the uploads to the SQL-Server.

I have to upload the positions collection before the head collection.

        Collect('[ONCR].[Position]', PosCache);
        Collect('[ONCR].[Head]', HeadCache);
        Collect('[ONCR].[feedback]_1', feedback);

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,396)