# Store payload value and match previous values

**URL:** https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166
**Category:** General
**Created:** [5 March 2024 18:12 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166 "2024-03-05T18:12:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)
#### Post date: [5 March 2024 18:12 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/1 "2024-03-05T18:12:18Z")

</div>

Hi all!

I need to store two values from two differents payloads let's say:

**Value 1**

```auto
payload: object
  event_name: "defect.created"
  payload: object
     id: 99

```

**Value 2**

```auto
payload: object
   case_number: 53234

```

Ok, i can retrieve id value from VALUE 1 perfectly but i need to store it somewhere so it can match case\_number from VALUE 2.  
In this case id 99 should be matched with case\_number 53234.

Is there any place where i can store them and make them match?.

Regards!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [5 March 2024 18:23 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/2 "2024-03-05T18:23:27Z")

</div>

You can use a change node and store values in context.

You can use a file node and write it to file

You can use database nodes and write to database.

---

<div class="post-metadata">

### Author: ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)
#### Post date: [5 March 2024 18:27 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/3 "2024-03-05T18:27:35Z")

</div>

Uhm ok.

I see that change node doesn't allow me to store the value anywhere.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a52dd7bf0138183500075ebe3ce418d01fd40fb.png)

I saw that previous versions of nodered there is a disk drive icon where you can select the output source where you want to store the value.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [5 March 2024 18:32 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/4 "2024-03-05T18:32:47Z")

</div>

By selecting flow.whatever\_you\_desire you have chosen to store a value in flow context named whatever\_you\_desire.

This might help you: [Working with context : Node-RED](https://nodered.org/docs/user-guide/context)

---

<div class="post-metadata">

### Author: ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)
#### Post date: [5 March 2024 20:58 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/5 "2024-03-05T20:58:08Z")

</div>

Maybe i will use google sheet to store data and then retrieve it when i need it. I will try it.  
Tks!

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [6 March 2024 08:36 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/6 "2024-03-06T08:36:11Z")

</div>

> [@Marty1982](#):
>
> previous versions...

You have to define the alternative context storage options in settings.js in order for that disk icon to appear... maybe that hasn't happened on this latest installation ?

---

<div class="post-metadata">

### Author: ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)
#### Post date: [10 April 2024 20:44 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/7 "2024-04-10T20:44:00Z")

</div>

Yes, i know that. But i dont want to touch the filesystem because is an enterprise server. So i decided to use context with flow setting and persist it in memory.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 July 2024 20:44 UTC](https://discourse.nodered.org/t/store-payload-value-and-match-previous-values/86166/8 "2024-07-09T20:44:08Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
