Extract data from response of Google Big Query SQL using JavaAction

1
Hi Team, I am able to connect to Google BigQuery SQL from my Mendix app using java action and BigQuery libraries. I am getting table data as response from it as well. But I find it difficult to extract the table info and add the data to my local entities. Is there any way to extract the data? Any help would be really appreciated. Thanks & Regards, Sushuma  
asked
2 answers
2

I would recommend using the Java libraries and process the data like this sample from

https://cloud.google.com/bigquery/docs/quickstarts/quickstart-client-libraries#bigquery_simple_app_print-java

// Get the results.
TableResult result = queryJob.getQueryResults();

// Print all pages of the results.
for (FieldValueList row : result.iterateAll()) {
  // String type
  String commit = row.get("commit").getStringValue();
  // Record type
  FieldValueList author = row.get("author").getRecordValue();
  String name = author.get("name").getStringValue();
  String email = author.get("email").getStringValue();

  MendixAuthor ma = new MendixAuthor(getContext());
  ma.setName(name);
  ma.setEmail(email);
  ma.commit;
}

 

answered
1

Hi Kartheek, 

Yes in the java action I am forming a Json structure and setting the values as key value. Now I am returning the json to my microflow and importing the data into the entity using import mapping. 

 

Thanks & Regards, 

Sushuma

answered