# SSD Assignment Audit Data storing issue

**URL:** https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227
**Category:** Training, Academy & Certifications
**Created:** [September 9, 2025, 12:30pm UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227 "2025-09-09T12:30:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mohammedrimshan](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@mohammedrimshan](https://community.neutrinos.com/u/mohammedrimshan)
#### Post date: [September 9, 2025, 12:30pm UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227/1 "2025-09-09T12:30:40Z")

</div>

![image](https://community.neutrinos.com/uploads/default/original/2X/8/88457309be978cdc3bd87ee64e2c213beeb4a6ad.png)

When i try to store audit data it show this error

---

<div class="post-metadata">

### Author: ![Simphiwe](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@Simphiwe](https://community.neutrinos.com/u/Simphiwe)
#### Post date: [September 9, 2025, 12:33pm UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227/2 "2025-09-09T12:33:40Z")

</div>

Hi @mohammedrimshan ,

Can you show the mappings on the node where you are trying to store the audit data.

---

<div class="post-metadata">

### Author: ![mohammedrimshan](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@mohammedrimshan](https://community.neutrinos.com/u/mohammedrimshan)
#### Post date: [September 9, 2025, 12:42pm UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227/3 "2025-09-09T12:42:51Z")

</div>

bh.local = bh.local || {};

try {  
const payload = bh.input || {};  
bh.local.auditData = {  
action: payload.action || “UNKNOWN”,  
entity: payload.entity || “N/A”,  
entityId: payload.entityId || null,  
user: payload.user || “system”,  
timestamp: payload.timestamp || new Date(),  
status: payload.status || “FAILED”,  
details: payload.details || {}  
};

```
console.log("Audit data ready:", bh.local.auditData);

```

} catch (err) {  
bh.local = bh.local || {};  
bh.local.error = err;  
console.error(“Audit error:”, err);  
throw err;  
}

this is inside the script node

 ![image](https://community.neutrinos.com/uploads/default/original/2X/a/ad7cf3a2c4d7ed994cc2312294436896e383a829.png)

 ![image](https://community.neutrinos.com/uploads/default/original/2X/a/a95007a126e6a0ea3ccede2d3a178833176c7200.png)

then when i creating the book i passed auditPayload

bh.local = bh.local || {};

bh.input.auditPayload = {  
action: “CREATE\_BOOK”,  
entity: “Book”,  
entityId: bh.local.result.book?.\_id || null,  
user: bh.input?.user || “system”,  
timestamp: new Date(),  
status: bh.local.result.status === “created” ? “SUCCESS” : “EXISTS”,  
details: {  
isbn: bh.local.result.book?.isbn,  
title: bh.local.result.book?.title,  
author: bh.local.result.book?.author,  
publishedYear: bh.local.result.book?.publishedYear  
}  
};

console.log(“Audit payload (nested):”, bh.input.auditPayload);

// Flatten payload to top-level bh.input  
bh.input = { …bh.input.auditPayload };  
console.log(“Flattened audit payload:”, bh.input);

 ![image](https://community.neutrinos.com/uploads/default/original/2X/a/a28a1ec3b4992597afc68e887d2b596ffd3e3948.png)

---

<div class="post-metadata">

### Author: ![Simphiwe](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@Simphiwe](https://community.neutrinos.com/u/Simphiwe)
#### Post date: [September 9, 2025, 1:12pm UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227/4 "2025-09-09T13:12:30Z")

</div>

@mohammedrimshan,

Are you only setting the error on the below code only ??

bh.local = bh.local || {};  
bh.local.error = err;

---

<div class="post-metadata">

### Author: ![mohammedrimshan](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@mohammedrimshan](https://community.neutrinos.com/u/mohammedrimshan)
#### Post date: [September 9, 2025, 1:19pm UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227/5 "2025-09-09T13:19:19Z")

</div>

yes , is there any change to make in here?

---

<div class="post-metadata">

### Author: ![Simphiwe](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@Simphiwe](https://community.neutrinos.com/u/Simphiwe)
#### Post date: [September 10, 2025, 7:15am UTC](https://community.neutrinos.com/t/ssd-assignment-audit-data-storing-issue/1227/6 "2025-09-10T07:15:02Z")

</div>

Hi @mohammedrimshan,

The code you provided seems fine, are you still getting the error??
