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

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,412)