# JSON undefined error

**URL:** https://www.finalbuilder.com/forums/t/json-undefined-error/7741
**Category:** Discussion
**Tags:** finalbuilder, actions
**Created:** [November 19, 2025, 8:25pm UTC](https://www.finalbuilder.com/forums/t/json-undefined-error/7741 "2025-11-19T20:25:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rjantz](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@rjantz](https://www.finalbuilder.com/forums/u/rjantz)
#### Post date: [November 19, 2025, 8:25pm UTC](https://www.finalbuilder.com/forums/t/json-undefined-error/7741/1 "2025-11-19T20:25:07Z")

</div>

Is there a way to use `JSON.parse` as in the following example in `AfterAction`?  
`if (ActionResult) {`  
` var data = JSON.parse(shareCommandOutput);`  
` ReleaseNotes += “\r\n” + "This build is available from " +data.URL;`  
`}`

This returns the error of:  
Error Executing script : AfterAction  
Microsoft JScript runtime error  
‘JSON’ is undefined  
Line: 3  
Char : 3

## Error in AfterScript : JavaScript

This Action did execute successfully however an error occurred in the AfterAction script.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 19, 2025, 11:09pm UTC](https://www.finalbuilder.com/forums/t/json-undefined-error/7741/2 "2025-11-19T23:09:12Z")

</div>

The active scripting engine doesn’t have a JSON object, so you have to include it manually

```auto
//USEUNIT "%FBDIR%\Scripts\json2.js"

var json = '{"result":true, "count":42}';
obj = JSON.parse(json);

alert(obj.count);

```

---

<div class="post-metadata">

### Author: ![rjantz](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@rjantz](https://www.finalbuilder.com/forums/u/rjantz)
#### Post date: [November 20, 2025, 3:49pm UTC](https://www.finalbuilder.com/forums/t/json-undefined-error/7741/3 "2025-11-20T15:49:03Z")

</div>

Yes, that worked as long as there was no space in front of _`//USEUNIT "%FBDIR%\Scripts\json2.js"`. I also happened to note that `%FBDIR%` includes a `\` so there was a double._
