JB

<pre> Here is my method, I have added this , action = {...action,...parsedData}; but still data is not getting merged data.actions can you see where is the issue</pre> <pre> async processJsonData3(jsonData: any[]): Promise&lt;any&gt; { const resultMap = {}; // Since jsonData is now inside the request object and is an array, we&#39;ll iterate over it for (const data of jsonData) { const index: number = jsonData.indexOf(data); let intent = &#39;Unknown&#39;; // Default value for intent if (data.queryResult &amp;&amp; data.queryResult.intent) { intent = data.queryResult.intent.displayName; } const userInput = data.queryResult.text; const messagesDisplayed: string[] = []; const optionsDisplayed: string[] = []; const userActions = data.actions || []; data.queryResult.responseMessages.forEach((message: any) =&gt; { if (message.text &amp;&amp; message.text.text) { messagesDisplayed.push(...message.text.text); } if (message.payload &amp;&amp; message.payload.richContent) { message.payload.richContent.forEach((content: any) =&gt; { content.forEach((item: any) =&gt; { if (item.type === &#39;chips&#39;) { const chipOptions = item.options.map((option: any) =&gt; option.text); optionsDisplayed.push(...chipOptions); } }); }); } }); for (let action of data.actions) { const text = action.encData; if (action.encData) { try { let decryptedData = await this.cryptoUtil.decrypt(action.encData, &#39;0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF&#39;); if (typeof decryptedData === &#39;string&#39;) { const parsedData = JSON.parse(decryptedData); if (typeof parsedData === &#39;object&#39;) { action = {...action,...parsedData}; } else { new Logger().log(&#39;Decrypted Data is not an object.&#39;); } } else { new Logger().log(&#39;Decrypted Data is not a string.&#39;); } } catch (error) { console.error(&#39;Decryption error:&#39;, error); } } } // Grouping actions by IntentName const actionsByIntent = data.actions.reduce((acc: any, action: any) =&gt; { const intentName = action.IntentName; if (!acc[intentName]) acc[intentName] = []; acc[intentName].push(action); return acc; }, {}); const key = `${intent}`; // Form the key as &quot;index-IntentName&quot; resultMap[key] = { intent, userInput, messagesDisplayed, optionsDisplayed, userActions: actionsByIntent, }; } return resultMap; }</pre>