Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

Posted on by 15,428

Hi

Is it possible to read CSV file from Azure Blob then create general journal in Business Central using BC Standard API? I do not mean theoretically or yes it is possible. I mean if someone wrote a blog about it or has some code? By code I mean Azure Logic App code or something like that. 

Thanks 

  • MahGah Profile Picture
    MahGah 15,428 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Hi Mr Bruvik

    You are amazing. Thank you so much for the code. I will try this in our Sandbox and if I run to an issue I will contact you. Please know I really appreciate your help here.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Hi MahGah !

    Sorry for the delay.

    Here is a very basic code that reads a file from a csv file from a blob storage and creates general journal lines.

    github.com/.../GenJorunalImport

    So far I only handle 3 fields  Account No. Amount and date.

    And most of it is hard coded for now and we can move that into a setup.

    And it is configured to read a file from my blob storage. You will have to change that to your own blob storage.

    You can e-mail me if you want and we can refine it further for your use.

  • MahGah Profile Picture
    MahGah 15,428 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Thanks yzhums  the article is helpful but deal with the file and not creating general journal. I just got stuck there.

  • MahGah Profile Picture
    MahGah 15,428 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Thanks Nitin Verma  your article is really helpful to download/upload file. But I am not sure how to create General Journal here?

  • MahGah Profile Picture
    MahGah 15,428 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Thanks DAnny3211  I tried to use the last 3 links but I get error 404. I can see the logic but still not sure about the code. I mean as a none-programmer it is hard to write the code.  

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Hi, here is also a simple example, hoping to give you some hints.

    https://www.linkedin.com/pulse/business-central-azure-blob-storage-bert-verbeek/

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Hi,

    You can go through my blog, where I am reading, storing, and deleting the file from Blob storage.

    www.navwithnav.com/.../

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    hi

    it is possible to read a CSV file from Azure Blob and create a general journal in Business Central using the BC Standard API.

    There are different ways to achieve this, and it may depend on your specific requirements and setup. However, here are some general steps and resources that could be helpful:

    Use Azure Logic Apps or Azure Functions to trigger the process when a new CSV file is uploaded to the Azure Blob Storage. You can use the Blob Storage connector to interact with the storage.

    Parse the CSV file to extract the data you need. You can use a CSV connector or a custom code.

    Use the Business Central Standard API to create the general journal entry. You can use the HTTP connector in Azure Logic Apps or the HTTP-triggered Azure Functions to send requests to the API.

    Map the CSV data to the general journal fields and lines, following the API specifications. You may need to create the necessary accounts, dimensions, and other entities in Business Central beforehand.

    Here are some resources that could be useful to implement these steps:

    Microsoft Docs provides guidance and examples on how to use the Azure Blob Storage, Logic Apps, Functions, and other Azure services:

    docs.microsoft.com/.../storage-quickstart-blobs-portal

    docs.microsoft.com/.../connectors-create-api-azure-function

    docs.microsoft.com/.../functions-create-your-first-function-visual-studio

    docs.microsoft.com/.../

    Microsoft provides an API reference for Business Central, including the endpoints and entities used to manage general journals:

    docs.microsoft.com/.../entity-generaljournalentry

    There are various examples and tutorials available online that show how to use the Business Central API from different platforms and languages, such as:

    community.dynamics.com/.../working-with-the-business-central-api-from-microsoft-power-automate

    github.com/.../Program.cs

    devblogs.microsoft.com/.../

    By combining these resources and adapting them to your specific needs, you should be able to read a CSV file from Azure Blob and create a general journal in Business Central using the BC Standard API.

    DAniele

  • MahGah Profile Picture
    MahGah 15,428 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Hi Mr Bruvik

    That is really kind of you. It is always harder to deal with BC development than Azure. But your kindness for sharing the code can help a lot.

    Thanks

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Read CSV File from Azure Blob then create General Journal in Business Central only using Standard API

    Yes, it is definitely possible.  But I do not use API for it. I have a codeubit that is running in a jobqueue checking for new files on a Azure blob storage folder.  I find it easier to customize it that way then using Azure Logic App.

    I am not on the right computer now, but I will share my code on Github later today if no one else comes to your requeue before me.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans