# 'Record Already Exist' Error via Call API Computed Column

**URL:** <https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476>\
**Category:** Ask for Help\
**Tags:** api\
**Created:** [September 24, 2023, 7:50am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476 "2023-09-24T07:50:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 24, 2023, 7:50am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/1 "2023-09-24T07:50:27Z")

</div>

Team,

I am making POST requests to an API, and occasionally I receive a response indicating that a ‘record already exists’. However, I am encountering difficulties in querying the JSON response as it is displayed in red text, suggesting it might not be recognised as a valid value. Is there a way to implement a function to check the existence of a record before making a POST request, or to handle this scenario.  
 ![Screen Shot 2023-09-24 at 5.50.04 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/e/3e39f4751c7f015f075a23bcefe2e6143c7f0c8c.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 24, 2023, 7:57am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/2 "2023-09-24T07:57:22Z")

</div>

Can you show us a sample output of the API call, and how you’re configuring the “parse\_id” column?

---

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 24, 2023, 8:02am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/3 "2023-09-24T08:02:07Z")

</div>

Thanks for looking into this. The response is:

```auto
{
  "meta": {
    "code": 4003,
    "message": "Tracking already exists.",
    "type": "BadRequest"
  },
  "data": {
    "tracking": {
      "tracking_number": "TRACKING_EXAMPLE",
      "custom_fields": {
        "EXAMPLE": "EXAMPLE"
      },
      "emails": "EMAIL",
      "slug": "SLUG",
      "id": "EXAMPLE_ID",
      "created_at": "2023-09-24T07:54:21+00:00"
    }
  }
}

```

JSONATA Query:

`data.tracking.id`

My speculation here is that if the text is not blue, Glide does not compute a valid value(?).

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 24, 2023, 8:10am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/4 "2023-09-24T08:10:43Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/a/da28fb3e790691aa0abdf44a2b1aea8a7aa36201.jpeg)

Doesn’t sound like you did anything wrong. Can you refresh the tab and try again?

---

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 24, 2023, 8:16am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/5 "2023-09-24T08:16:43Z")

</div>

That’s what I am referring to. The query works if the text is blue and in your case pasted in directly, but the red text is not considering it as a value. I’ve even considered using a template column, but it is returning a blank value.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 24, 2023, 8:18am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/6 "2023-09-24T08:18:01Z")

</div>

Does the `data` section of the JSON actually exist when the error is returned?

---

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 24, 2023, 8:26am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/7 "2023-09-24T08:26:52Z")

</div>

It likely does not. On a JSON response where the query is not written correctly, it returns a blank value. In this case, it returns a “null”.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 24, 2023, 8:29am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/8 "2023-09-24T08:29:07Z")

</div>

Okay, so that explains it then.

What you probably want to do is add another Query JSON column that extracts the Status code (`meta.code`), and perhaps the message, and then take appropriate action based on the value of that code/message.

---

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 24, 2023, 8:35am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/9 "2023-09-24T08:35:48Z")

</div>

With `meta.code` implemented, the response is as follows. Line 2 should show “429”. However it is returning null.

![Screen Shot 2023-09-24 at 6.34.02 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/d/ddf7b4644c344427e287ff09a72efdfc6526f13c.png)  
 ![Screen Shot 2023-09-24 at 6.35.14 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/1/3131bcdf80ad45f464a9f3db9e8529cc727404eb.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 24, 2023, 8:39am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/10 "2023-09-24T08:39:44Z")

</div>

Interesting. Might be a bug. Let me see if I can replicate that.

Update: @RyanRaj - yes, I can replicate this. I think it might be a bug. I’ve reported it.

---

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 24, 2023, 8:52am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/11 "2023-09-24T08:52:29Z")

</div>

Awesome, thanks for your help 🙏🏼

---

<div class="post-metadata">

**Author:** ![RyanRaj](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ryanraj/32/60415_2.png) [@RyanRaj](https://community.glideapps.com/u/RyanRaj)\
**Post date:** [September 25, 2023, 5:32am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/12 "2023-09-25T05:32:30Z")

</div>

Hey @Darren_Murphy is there a ticket or a link where I may be able to follow the reported bug?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 25, 2023, 5:43am UTC](https://community.glideapps.com/t/record-already-exist-error-via-call-api-computed-column/66476/13 "2023-09-25T05:43:15Z")

</div>

No, sorry.  
I’ll let you know if/when I get any update.
