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:

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard