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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Issue Saving Records f...
Power Apps
Unanswered

Issue Saving Records from PowerApps to PostgreSQL - Enum and Data Insertion Problem

(0) ShareShare
ReportReport
Posted on by 2

Hello developers,

I’m currently working on integrating PowerApps with a PostgreSQL database but facing some issues when trying to insert records. The problem seems to be around the enums and how the data is being handled.

Database Structure:

I have a table named Order in PostgreSQL with the following structure:

Column Type Nullable Default
id integer not null nextval('Order_id_seq'::regclass)
title varchar(255)    
status OrderStatus    
fulfillmentStatus FulfillmentStatus    
fulfillmentType FulfillmentTypes    
docNumber text    
date timestamp(3)    
postedDate timestamp(3)    
total double precision    
createdAt timestamp(3) not null CURRENT_TIMESTAMP
updatedAt timestamp(3) not null  
... (other fields)      

Here, status, fulfillmentStatus, and other columns like paymentMethod, region are enums defined in PostgreSQL.

Enum Definitions (Example):

  • OrderStatus: ['Pending', 'Confirmed', 'Shipped', 'Delivered', 'Cancelled']
  • FulfillmentStatus: ['Not Started', 'In Progress', 'Complete']
The problem,

I am using PowerApps to insert a record into this table using the following Patch function:

Patch(
'public.Order',
Defaults('public.Order'),
{
title: "New Order",
status: "Confirmed", // Enum value
fulfillmentStatus: "Complete", // Enum value
date: DateValue("2024-09-23"),
total: 120.50
}
);

I am passing the status as a string (e.g., “Confirmed”), which matches the enum defined in the PostgreSQL table. However, I keep encountering errors related to type mismatch:

Error I am getting, 

"The type of column 'status' doesn't match the type of the column in the table."

I tried the following,

  • I've confirmed that the values I’m passing for the enums match the exact strings defined in the database.
  • I’ve tried using different formats (quoted strings, escaped values) but no luck so far.
  • Tried escaping enum values (e.g., status: "\"Confirmed\""), but this also didn’t work.
  • The record-saving operation keeps failing with a "Network Error" or a "type mismatch" error.

Has anyone successfully inserted records into a PostgreSQL table with enums from PowerApps? Any guidance on how to properly handle enum fields in this context would be greatly appreciated. Is there a specific format or function that I might be missing when passing enum values from PowerApps?

Thanks in advance for any suggestions or tips!

Categories:
I have the same question (0)
  • Micky Profile Picture
    365 Moderator on at
    Hello,
     
    Have you tried inserting the Enum ID?
    You can do a test, you can get Enum ID of Confirmed from OrderStatus and try to use that to populate status in Power Apps Patch function.
     
    Regards,
    MMPoweR
  • roshanruzaik81 Profile Picture
    2 on at
     
    "Hello,
     
    Have you tried inserting the Enum ID?
    You can do a test, you can get Enum ID of Confirmed from OrderStatus and try to use that to populate status in Power Apps Patch function.
     
    Regards,
    MMPoweR"
     
    Hi MMPowerR


     
    Thanks for the response,
     
    Yes,I did try to insert corresponding ID to the table. Yet results were the same.
     
     
     
     
     
     
     
  • RC-08052220-0 Profile Picture
    4 on at
    I'm having the same issue with the citext data type.  Power Apps doesn't seem to recognise custom data types.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard