Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to write text field to blob?

Posted on by 422

I'm trying to make an http request. Now I need to add a body to my request, that body has to be of the type Blob. 

At the moment I don't have a blob so my question is how I can convert the textfield I have now to an object to the type blob so I can use that in my requestbody.

Thanks in advance.

EDIT: 

With the tempblob record i created an outstream and added the text to it:

TempBlob.INIT;
OutStream.WRITETEXT(payload);
TempBlob.Blob.CREATEOUTSTREAM(OutStream);
TempBlob.INSERT;
TempBlob.CALCFIELDS(Blob);

Is it now ok if i simply do this to add it to the body?:
TempBlob.GET(TempBlob.Blob);
HttpWebReqMgt.AddBodyBlob(TempBlob);

  • Community member Profile Picture
    Community member 12 on at
    How to write text field to blob?
    When dealing with text field to blob conversion, it's crucial to understand the intricacies. For a comprehensive guide, check out https://www.typingservice.org/blog/manual-vs-automated-transcription/. This resource not only sheds light on the manual vs. automated transcription debate but also provides valuable insights into optimizing text-to-blob processes, ensuring efficient data handling and storage.
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to write text field to blob?

    empBlob.INIT;

    OutStream.WRITETEXT(payload);

    TempBlob.Blob.CREATEOUTSTREAM(OutStream);

    TempBlob.INSERT;

    TempBlob.CALCFIELDS(Blob);

  • SebastianBarlow Profile Picture
    SebastianBarlow 10 on at
    RE: How to write text field to blob?

    Thanks for the help

  • David Oliviera Profile Picture
    David Oliviera 10 on at
    RE: How to write text field to blob?

    Great solution, thank you

  • Suggested answer
    THE Italian Profile Picture
    THE Italian on at
    RE: How to write text field to blob?

    You are in need to convert the blob back and forth into a 64base encoded string.

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