# A direct way to return data from a script action for use in later steps or rich text fields

**URL:** <https://community.fibery.io/t/a-direct-way-to-return-data-from-a-script-action-for-use-in-later-steps-or-rich-text-fields/8063>\
**Category:** Get Help\
**Tags:** automations\
**Created:** [January 6, 2025, 2:41am UTC](https://community.fibery.io/t/a-direct-way-to-return-data-from-a-script-action-for-use-in-later-steps-or-rich-text-fields/8063 "2025-01-06T02:41:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![helloitse](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/helloitse/32/498_2.png) [@helloitse](https://community.fibery.io/u/helloitse)\
**Post date:** [January 6, 2025, 2:41am UTC](https://community.fibery.io/t/a-direct-way-to-return-data-from-a-script-action-for-use-in-later-steps-or-rich-text-fields/8063/1 "2025-01-06T02:41:19Z")

</div>

When I use return in a script at the end of an action, the data is JSON.stringified and added to the message object. I would normally end a script with something like this:

```auto
// Return contactInfo and the paymentURL 
return {
    contactInfo: htmlString,
    paymentURL: paymentURL
};

```

When I want to use the data later I have to do this:  
`<% JSON.parse(args.steps[2].result.message.slice(7)).paymentURL %>`

Is there a different way to send outputs so I can call them directly?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 6, 2025, 8:30am UTC](https://community.fibery.io/t/a-direct-way-to-return-data-from-a-script-action-for-use-in-later-steps-or-rich-text-fields/8063/2 "2025-01-06T08:30:27Z")

</div>

I don’t think there is any more efficient way of extracting info from the return message.
