Skip to content

gmullernh/csharp-azurefunctions-excel-to-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

azurefunctions-excel-to-json

Sample Azure Function to convert Excel (XLS or XLSX) files and CSV to JSON strings.

Use cases

A few use cases this solution can be used on:

  • Data Science projects, to convert different sources into a common data format.
  • To convert user inputed data from Excel files into a developer friendly format as JSON.

Sending a request directly

You can send a POST request passing the file as a FormData to the Azure Functions endpoint.

POST

{
    "data": dataBlobContent
}

Sending from a HTML form

You can send a POST request from a web page using a form as input.

This example uses jQuery, but you can do this from native javascript, React, Angular and any other web framework.

    // Gets the first file uploaded from the form component.
    var data = new FormData();
    data.append("file",$('<your-form-id>')[0].files[0]);
    
    // AJAX request.
    $.ajax({
        method: "POST",
        url: "<your-endpoint-url>",
        crossDomain: true,
        enctype: 'multipart/form-data',
        cache : false,                  // disables caching for this request
        processData : false,            // ensures no processing will be done on the content by the jQuery library
        data: data                      // the content as a FormData file.
    });

About

Convert Excel files to JSON using Azure Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages