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 Automate / C# Code for Databricks...
Power Automate
Unanswered

C# Code for Databricks API parse.

(0) ShareShare
ReportReport
Posted on by 2

Hi, I'm trying to use code from this website to parse somehow Databrick API Response. 

https://medium.com/@kyle.hale/step-by-step-connecting-to-databricks-sql-in-microsoft-power-apps-de773df5e4bf

 

Without Code enabled, everything works I got 200 response with the data that I want.

With the code below I got error. Any suggestions?

 

 

public class Script : ScriptBase

{

public override async Task<HttpResponseMessage> ExecuteAsync(){
HttpResponseMessage response = await this.Context.SendAsync(
this.Context.Request,
this.CancellationToken);

var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(
continueOnCapturedContext: false
);

var result = JObject.Parse(responseString);
var _resultSet = new List<Dictionary<string, Newtonsoft.Json.Linq.JToken>>();
var _columns = new List<string>();

foreach (var _c in result["manifest"]["schema"]["columns"]) {
_columns.Add( _c["name"].ToString()) ;
}

foreach (var _r in result["result"]["data_array"]) {
var _newRow = new Dictionary<string, Newtonsoft.Json.Linq.JToken>();
var _colIndex = 0;
foreach (var _f in _r) {
_newRow.Add(_columns[_colIndex], _f );
_colIndex++;
}
_resultSet.Add(_newRow);
}
 var y = new Dictionary<string,List<Dictionary<string, Newtonsoft.Json.Linq.JToken>>>() {
 {"results" , _resultSet } };

response.Content = CreateJsonContent(JsonConvert.SerializeObject(y));
return response;
}

}
Failed to provision compute for custom code. Request failed with error 'Code: BadRequest. Message: Unable to find an unassigned function app in 'West US'.'. The correlation Id is 'f9c88d51-fc9a-4881-a78b-7a3e99f82387'.

 

 

 

Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 641

#2
Vish WR Profile Picture

Vish WR 640

#3
Haque Profile Picture

Haque 495

Last 30 days Overall leaderboard