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 / how to insert 30 colum...
Power Apps
Suggested Answer

how to insert 30 columns in a table, using flow?

(1) ShareShare
ReportReport
Posted on by 26
using custom connector to insert data from power apps to databricks table. used parse json and in http body statement used insert statement to insert data. but data is not inserting.
 
let me know if any other method is available.
Categories:
I have the same question (0)
  • Suggested answer
    VASANTH KUMAR BALMADI Profile Picture
    322 on at

    You won’t be able to insert data into a Databricks table by sending an SQL INSERT statement in the HTTP body — that approach doesn’t work with Databricks REST APIs.

    Databricks does not execute raw SQL from generic HTTP requests, even if Parse JSON succeeds. The API will accept the request but silently won’t write data, which is what you’re seeing.

    Why your current approach fails

    • INSERT INTO table VALUES (…) in HTTP body is not supported

    • Parse JSON only validates the response structure

    • Databricks REST endpoints require specific APIs, not free-form SQL

    • SQL execution works only through:

      • Databricks SQL Statement Execution API

      • Jobs API

      • Delta Lake file writes

    So Power Apps → Custom Connector → “INSERT SQL” will never persist data.

    Working methods (used in real projects)

    Method 1 — Databricks SQL Statement Execution API (recommended)

    Use the Databricks SQL REST API:

    POST /api/2.0/sql/statements
    

    Example body:

    {
      "statement": "INSERT INTO my_schema.my_table VALUES ('101','John','90')",
      "warehouse_id": "xxxx-warehouse-id"
    }
    

    Requirements:

    • SQL Warehouse must be running

    • Token must have SQL permissions

    • Table must be Delta table

    This is the only supported way to run INSERT statements through REST.

    Method 2 — Create a Databricks Job (most stable)

    1. Create a Databricks notebook:

    data = {
        "EmpId": dbutils.widgets.get("EmpId"),
        "Name": dbutils.widgets.get("Name"),
        "Score": dbutils.widgets.get("Score")
    }
    
    spark.createDataFrame([data]).write.mode("append").saveAsTable("my_table")
    
    1. Call it from Power Automate / Custom Connector using:

    POST /api/2.1/jobs/run-now
    

    Pass values as notebook parameters.

    This method is:

    • very reliable

    • scalable

    • commonly used in enterprise integrations

    Method 3 — Write to ADLS → Auto Loader (best architecture)

    Flow:

    Power Apps
       ↓
    Power Automate
       ↓
    ADLS Gen2 (JSON / CSV)
       ↓
    Databricks Auto Loader
       ↓
    Delta Table
    

    This is how Databricks ingestion is normally designed.

    Advantages:

    • no API throttling

    • high volume support

    • full retry handling

    • best performance

    What is NOT supported

    ❌ Insert SQL via generic HTTP body
    ❌ Parse JSON → insert logic
    ❌ Direct JDBC from Power Apps
    ❌ Databricks REST without SQL warehouse

    Recommended approach

    For Power Apps integrations:

    • Small / real-time writes → SQL Statement API

    • Enterprise / bulk ingestion → ADLS + Auto Loader

    • Complex logic → Databricks job / notebook

    Final answer

    Your issue isn’t with Power Apps or the connector — Databricks simply does not support executing raw INSERT statements through standard HTTP APIs.

    You must use either:

    • Databricks SQL Statement Execution API

    • Databricks Job / Notebook execution

    • ADLS ingestion pattern

    Once you switch to one of these, inserts will work correctly.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard