cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mjsonline
New Member

Inserting Records - Primary Key set to database sequence?

Hi there,

 

I'm creating an application to insert records into a Postgres database, but having problems with the Primary Key.

 

Powerapps is insisting that I try to set a value, despite the database being set to default new records to the next value in the sequence.

 

Is there anyway I can force PowerApps to rely on the database sequence?

10 REPLIES 10
FatimahAlQadib
Helper I
Helper I

I am using MySql DB. And I do the following,

You have to make sure that your primary key value is set to Autoincrement. Then in your Patch set the primary key into 0 value. The DB will take responsibility for the sequence.   

 

OnSelect= Patch('[database_name].[table_name]',Defaults('[database_name].[table_name]'),{column_primary_key:0, column__2: ... });

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (48,922)