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

Patching primary key not display value from drop down list

I have a drop down control, which i connected to datasource which is a view in Sql Azure;

 

CREATE VIEW dbo.Area_types
AS
SELECT Id, Value
FROM dbo.Lookup
WHERE (Type = 6)

 

The ID is the primary key and the Value is the Diplay Name. eg 1 = Kitchen, 2 = Bathroom

 

I want the drop down to diplay Kitchen, Bathroom.

When I want to Patch to a table called Job_Pictures I want to use the primary key. Seems like a simple job, but been at it for some time :).

 

Patch('[dbo].[Job_Pictures]';Defaults('[dbo].[Job_Pictures]');{The_image:Camera1.Photo; Job:Job; Type_of_area:Dropdown2.Selected }))

 

CREATE TABLE [dbo].[Job_Pictures] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Job] VARCHAR (40) NULL,
[Job_task] INT NULL,
[The_image] VARCHAR (MAX) NULL,
[Type_of_area] SMALLINT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @jamess 

I think you're just missing the Id property from the selected item of your dropdown. Hopefully, this will work a better for you.

 

Patch('[dbo].[Job_Pictures]';
Defaults('[dbo].[Job_Pictures]');
{The_image:Camera1.Photo;
Job:Job;
Type_of_area:Dropdown2.Selected.Id
}
)

View solution in original post

1 REPLY 1
timl
Super User
Super User

Hi @jamess 

I think you're just missing the Id property from the selected item of your dropdown. Hopefully, this will work a better for you.

 

Patch('[dbo].[Job_Pictures]';
Defaults('[dbo].[Job_Pictures]');
{The_image:Camera1.Photo;
Job:Job;
Type_of_area:Dropdown2.Selected.Id
}
)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,016)