# 'Add to existing' - Web requests

**URL:** <https://community.appfarm.io/t/add-to-existing-web-requests/582>\
**Category:** Ask the community\
**Tags:** actions, web-request\
**Created:** [August 1, 2023, 10:17am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582 "2023-08-01T10:17:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [August 1, 2023, 10:17am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/1 "2023-08-01T10:17:27Z")

</div>

Hi,

I’m setting up a new web request that should update existing records if the ID exists in the runtime table. But for some reason this is not happening. Is this a bug or something I’m misunderstanding

Setup:  
Webrequest is setup to update existing based on the field RecId1 if it does not exists it should be added to the datasource.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/c233027961aa759568c0b76c6432bef43052eafe.png)

But every time I trigger the action to run the web request a new record with the same RecId1 value is created

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/bcbf22f3c8d7ecfc8e3aac83005366542486bb1e.png)

---

<div class="post-metadata">

**Author:** ![Simona](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/simona/32/201_2.png) [@Simona](https://community.appfarm.io/u/Simona)\
**Post date:** [August 1, 2023, 11:11am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/2 "2023-08-01T11:11:04Z")

</div>

Hi Preben,

I had a similar case, but I’m not sure if you have the same issue as I had.

- Do you use the web request in a service?
- Is the invoice lines (temp) a cardinality one datasource?
- How do the logs look like? Do you get an error message there?

The workaround that I used was to have a datasource to map in the request, and another datasource that you update with the update action node after the web request was send.

---

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [August 1, 2023, 12:45pm UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/3 "2023-08-01T12:45:07Z")

</div>

1. The web request is not in a service
2. Invoice lines is a cardinality many datasource
3. No error messages

I have used the same setup as this in another web request and another datasource. So would really like to understand why it is not working as expected now. Instead of making a more complex solution 🙂

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 1, 2023, 2:25pm UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/4 "2023-08-01T14:25:25Z")

</div>

Hi!

I just tried a similar setup, and it works as expected by adding new object to the data source, and updating the mapped properties on the existing objects (“existing” defined by the Mapping Property).

Have you included the RecId1 in the Property Mapping list as well (it needs to be).

If so: Could you try to set up the Action Node once more (disabling the old one), just to see if there is old fun stored in the metadata of the action node?

---

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [August 2, 2023, 6:29am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/6 "2023-08-02T06:29:36Z")

</div>

I was a bit quick on my last test. The new action node did not solve anything. I still get the same result of duplicate records.

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 2, 2023, 7:01am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/7 "2023-08-02T07:01:57Z")

</div>

Have you cheched the data type received in the web request vs what’s stored? Maybe you receice recid as a string and it is saved as integer in the existing record, or vice versa.

---

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [August 2, 2023, 7:10am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/8 "2023-08-02T07:10:11Z")

</div>

You are correct 👍 It was set up as a string , should be int. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [August 8, 2023, 8:27am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/9 "2023-08-08T08:27:15Z")

</div>

@kristian - I’m trying to set up a similar “add to existing” for a new data source, but then I notice that the INT fields are greyed out and not able to be selected as a mapping property. I guess this is a bug?

For the case we discussed above, I changed the property from string to int and therefore it is already selected in the mapping property, and it works as expected.

Workaround for me is to set this field as a int, select it in the mapping property and change it again to int.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/f15df02decaed2ef8b57030654fc7623dd2d1d30.png)

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 9, 2023, 10:56am UTC](https://community.appfarm.io/t/add-to-existing-web-requests/582/10 "2023-08-09T10:56:19Z")

</div>

Yes, I believe it should also work / be possible to set up for integers. Registering a challenge on that one!
