# BLOB to show up in an indicator block

**URL:** <https://forums.losant.com/t/blob-to-show-up-in-an-indicator-block/3268>\
**Category:** Help\
**Tags:** dashboard\
**Created:** [September 18, 2020, 1:54pm UTC](https://forums.losant.com/t/blob-to-show-up-in-an-indicator-block/3268 "2020-09-18T13:54:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sreyams\_Jain1](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Sreyams\_Jain1](https://forums.losant.com/u/Sreyams_Jain1)\
**Post date:** [September 18, 2020, 1:54pm UTC](https://forums.losant.com/t/blob-to-show-up-in-an-indicator-block/3268/1 "2020-09-18T13:54:25Z")

</div>

I have a need to show a blob value of type text/html in an indicator block. Blobparts are an Array. I get an error “Blob not defined” in the code below. I am trying to assign the blob to an attribute in the device which is defined as blob, type text/html

var invStr;  
var itemsInList = false;  
var i=0;  
var blobParts =;

while (itemsInList == false && i \< payload.working.facility.length)  
{  
if (payload.working.facility[i].length \> 0)  
{  
itemsInList = true;  
invStr = payload.working.facility[i][0];

```
    blobParts.push("'<html>New PO issued for the following:" + invStr + "'");
    blobParts.push("'invStr" + "</html>'");

    var POBlob = new Blob(blobParts, {type : 'text/html', endings: "transparent"});
    payload.working.invDevice.POTag = POBlob;
}
i++;

```

}

---

<div class="post-metadata">

**Author:** ![Sreyams\_Jain1](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Sreyams\_Jain1](https://forums.losant.com/u/Sreyams_Jain1)\
**Post date:** [September 18, 2020, 2:39pm UTC](https://forums.losant.com/t/blob-to-show-up-in-an-indicator-block/3268/4 "2020-09-18T14:39:07Z")

</div>

blob.min.js - how to reference blob constructor in a function node in a workflow?

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [September 18, 2020, 2:49pm UTC](https://forums.losant.com/t/blob-to-show-up-in-an-indicator-block/3268/7 "2020-09-18T14:49:21Z")

</div>

@Sreyams_Jain1,

Just to help, it looks like you’re trying to use the [Javascript Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob). Losant Blobs are different and are reported as base64 encoded strings. Like so:

```auto
{
  "data" : {
    "image": "/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2===",
  },
  "time": <Optional Timestamp>,
  "flowVersion": <Optional Workflow Version Name>
}

```

In your case, if you’re trying to generate blob attribute data within the Function Node, you would need to:

1. Generate your HTML (looks like your code accomplishes this).
2. [Base 64 encode the HTML String](https://developer.mozilla.org/en-US/docs/Glossary/Base64#:~:text=Base64%20is%20a%20group%20of,into%20a%20radix%2D64%20representation.&text=One%20common%20application%20of%20base64,included%20in%20a%20data%3A%20URL.)

Then, later in your workflow, you can use the base64 encoded HTML string as the data for your blob attribute in the Device State Node.

To address your comment here:

> [@Sreyams\_Jain1](#):
>
> I have a need to show a blob value of type text/html in an indicator block

Unfortunately, the Indicator Block doesn’t support HTML. HTML could be displayed in the [Custom HTML Block](https://docs.losant.com/dashboards/custom-html/). But that block requires knowledge of HTML, CSS, and JS.

Resource:

> **[Blob Attributes](https://docs.losant.com/devices/blobs/)**
>
> Learn about device attributes and how they are used in the Losant Platform.
