# Query Location by Name returns empty data

**URL:** <https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903>\
**Category:** GraphQL API\
**Created:** [March 10, 2022, 3:17am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903 "2022-03-10T03:17:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Altair](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Altair](https://community.shiphero.com/u/Altair)\
**Post date:** [March 10, 2022, 3:17am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/1 "2022-03-10T03:17:52Z")

</div>

Hi Team,

We are trying to get the location details of a particular location using the `location` query by name. However, the API returns a null value on data even though this location already exists on the dashboard. Can you help us check on this? This is the request ID: `62296c8e410ac50ccec27b0d`

Here is our query:

```auto
query getLocation {
  location(name: "D2D-TL1") {
    complexity
    request_id
    data {
        id
        legacy_id
        name
        warehouse_id
    }
  }
}

```

Then this is the API response:

```auto
{
    "data": {
        "location": {
            "complexity": 1,
            "request_id": "62296c8e410ac50ccec27b0d",
            "data": null
        }
    }
}

```

Looking forward for your response. Thank you.

Kind Regards,  
Altair

Cc: @ddl @Edwin

---

<div class="post-metadata">

**Author:** ![iescobar](https://avatars.discourse-cdn.com/v4/letter/i/4491bb/32.png) [@iescobar](https://community.shiphero.com/u/iescobar)\
**Post date:** [March 10, 2022, 10:17pm UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/2 "2022-03-10T22:17:27Z")

</div>

Hello @Altair

To achieve what you are asking for, you can use the following query:

```auto
query getLocation {
  location(id: "id of the location ex: 5548973") {
    complexity
    request_id
    data {
        id
        legacy_id
        name
        warehouse_id
    }
  }
}

```

I replicate the case on my test account, and it looks if I search for location name, I get null data.  
But I tried with the location ID, and the response was successful.  
Please let me know if this doesn’t solve your concern.

Have a nice day!

Ignacio

---

<div class="post-metadata">

**Author:** ![Altair](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Altair](https://community.shiphero.com/u/Altair)\
**Post date:** [March 14, 2022, 2:23am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/3 "2022-03-14T02:23:05Z")

</div>

Hi @iescobar,

This is not really our use case. What we are trying to achieve is to qet the location ID by querying the location by name. When a new location is created on dashboard, we need to store that new location information on our internal DB including the location ID, but before we do that is we need to identify the location ID of the location first so we can’t use the get location by ID query. The current query that I provided above doesn’t work and it always returns a null value.

Hope you can check out with this. Thank you.

Kind Regards,  
Altair

---

<div class="post-metadata">

**Author:** ![Altair](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Altair](https://community.shiphero.com/u/Altair)\
**Post date:** [March 16, 2022, 1:33am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/5 "2022-03-16T01:33:11Z")

</div>

Hi @iescobar @tomasfd ,

Can I follow up you with this issue if there’s any update on this?

Kind Regards,  
Altair

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [March 21, 2022, 1:39pm UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/6 "2022-03-21T13:39:46Z")

</div>

Hello @altair!

What process did you use to create those bins? Do you remember by chance?

Was it API, CSVs, or manually?

Kind regards,  
TomasFD

---

<div class="post-metadata">

**Author:** ![Altair](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Altair](https://community.shiphero.com/u/Altair)\
**Post date:** [March 22, 2022, 8:03am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/7 "2022-03-22T08:03:26Z")

</div>

Hi @tomasfd,

We have some locations that we added via API, CSV’s and manual and all of these are not able to retrieve the location id by location name.

Kind Regards,  
Altair

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [March 28, 2022, 11:04pm UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/8 "2022-03-28T23:04:20Z")

</div>

Hello @Altair!

We had to bring this issue to our engineering team. I will let you know as soon as I have an update from them!

Have a great day!  
TomasFD

---

<div class="post-metadata">

**Author:** ![cmora](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cmora](https://community.shiphero.com/u/cmora)\
**Post date:** [June 26, 2022, 10:21pm UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/10 "2022-06-26T22:21:45Z")

</div>

Hello @tomasfd , do you have any update about this issue?  
I’ve just encountered the same issue that @Altair had: when trying to get the location\_id of a bin by querying by their name, I just get null data.  
If you have any update about this issue I would greatly appreciate it!

Best regards,  
Cristóbal

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [June 27, 2022, 11:33am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/11 "2022-06-27T11:33:35Z")

</div>

Hey @cmora,

This issue is still making its way to our Engineering Team, however I have bumped the issue again in hopes of getting it escalated.

Thanks for hanging in there while we sort this one out.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![cmora](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cmora](https://community.shiphero.com/u/cmora)\
**Post date:** [March 21, 2023, 8:05pm UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/12 "2023-03-21T20:05:25Z")

</div>

Hello @sh-agent !

Do you know if this was ever fixed by the engineering team?  
I’ve just tried to query filtering by name, but without success.

Thanks,  
Cristóbal

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [March 22, 2023, 11:47am UTC](https://community.shiphero.com/t/query-location-by-name-returns-empty-data/1903/13 "2023-03-22T11:47:18Z")

</div>

Hey @cmora,

Thanks for hanging in there!

I’ll go ahead and bump this issue again. I’ll let you know when a fix has been pushed for this one.  
Please let me know if you have any questions or concerns.

Best,  
RayanP
