# When using Rest API how can I use data from a handled error within On error workflow?

**URL:** <https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161>\
**Category:** How do I?\
**Created:** [September 22, 2022, 9:43am UTC](https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161 "2022-09-22T09:43:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjmcdonough](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tjmcdonough](https://community.weweb.io/u/tjmcdonough)\
**Post date:** [September 22, 2022, 9:43am UTC](https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161/1 "2022-09-22T09:43:58Z")

</div>

How can I use the data object from a handled 400 error within the On error workflow? I can’t see a way to access the data within the actions.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1ee96ffd322e2b2f36fa5e970bccc30b20715266.png)

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)\
**Post date:** [September 22, 2022, 11:25am UTC](https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161/2 "2022-09-22T11:25:41Z")

</div>

The same error that you see in the sidebar is available under the name “current error”

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/848917b400801a9febb02894d06e867471239a98.png)

---

<div class="post-metadata">

**Author:** ![tjmcdonough](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tjmcdonough](https://community.weweb.io/u/tjmcdonough)\
**Post date:** [September 22, 2022, 12:03pm UTC](https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161/3 "2022-09-22T12:03:20Z")

</div>

That is weird, I saw that but it was coming up empty for me

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)\
**Post date:** [September 22, 2022, 12:11pm UTC](https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161/4 "2022-09-22T12:11:51Z")

</div>

It’s empty in the editor until you test the workflow and it fails

---

<div class="post-metadata">

**Author:** ![ahusset](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@ahusset](https://community.weweb.io/u/ahusset)\
**Post date:** [October 25, 2022, 1:53pm UTC](https://community.weweb.io/t/when-using-rest-api-how-can-i-use-data-from-a-handled-error-within-on-error-workflow/1161/5 "2022-10-25T13:53:16Z")

</div>

you have to make the difference between the result of a step and the result of the Workflow.  
if the workflow is on error then the on error is played but if you test the step, the step is on error but the workflow is not yet on error.

when the Workflow is on error then you have a second message

 ![Capture d’écran 2022-10-25 à 15.49.57](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/78f6fd6a48cf508c97c75745f4adf54be0b9051a.png)  
 ![Capture d’écran 2022-10-25 à 15.50.14](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/17fba79055631db8fc3cf228048655f684d82627.png)
