web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching primary key n...
Power Apps
Answered

Patching primary key not display value from drop down list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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)
);

Categories:
  • Verified answer
    timl Profile Picture
    37,355 Super User 2026 Season 2 on at

    Hi @Anonymous 

    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
    }
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard