# Reference a field in a JSON Query

**URL:** <https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892>\
**Category:** Ask for Help\
**Created:** [November 14, 2024, 12:54am UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892 "2024-11-14T00:54:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Laird\_Jamieson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/craig_laird_jamieson/32/73155_2.png) [@Craig\_Laird\_Jamieson](https://community.glideapps.com/u/Craig_Laird_Jamieson)\
**Post date:** [November 14, 2024, 12:54am UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/1 "2024-11-14T00:54:41Z")

</div>

Hi

Looking for some advice, I am trying to filter JSON query with a field from the table, but are unable to get it to work.

Where table-field-name is the name of the field in the Glide Table.

Would appreciate any assistance.

$join(  
data.data[domain = ‘table-field-name’].domain & ‘=’ & data.data[domain = ‘table-field-name’].rank\_absolute,  
", "  
)

Thanks  
Craig

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [November 14, 2024, 1:03am UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/2 "2024-11-14T01:03:49Z")

</div>

Hola!

Show your JSON payload here in order to understand its structure and make some tests.

Bye

---

<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:** [November 15, 2024, 1:55am UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/3 "2024-11-15T01:55:52Z")

</div>

Can you please provide a sample of your JSON? Looks like you’re trying to:

- Filter objects within `data.data` based on whether their `domain` field matches `'table-field-name'`.
- For each matching object, concatenate the `domain` value with its `rank_absolute` value using an `=` sign.
- Join each resulting `domain=rank_absolute` pair with `", "` to create a single string of values.

---

<div class="post-metadata">

**Author:** ![Craig\_Laird\_Jamieson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/craig_laird_jamieson/32/73155_2.png) [@Craig\_Laird\_Jamieson](https://community.glideapps.com/u/Craig_Laird_Jamieson)\
**Post date:** [November 18, 2024, 11:52pm UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/4 "2024-11-18T23:52:15Z")

</div>

Thank you for replying, below is a section of the JSON, I had to alter the domains to post to the forum.

Craig

{  
“status”: “ok”,  
“result”: 1,  
“data”: {  
“tool name”: “Rank Checker”,  
“data”: [  
{  
“type”: “organic”,  
“rank\_group”: 1,  
“rank\_absolute”: 1,  
“domain”: “xx”,  
“title”: “Loop Backup AI – Cloud To Cloud Backup [Free Assisted …”,  
“description”: “Loop Backup uses immutable air gapped cloud storage and run by artificial intelligence with our money back guarantee if you are unable to restore your cloud …”,  
“url”: “[https://xx](https://xx)”,  
“breadcrumb”: “[https://xx](https://xx)”  
},  
{  
“type”: “organic”,  
“rank\_group”: 2,  
“rank\_absolute”: 2,  
“domain”: “www.”,  
“title”: “Cloud Backup - Loop”,  
“description”: “Unlimited cloud backup for all your memories! Shipping information.”,  
“url”: “[https://www.j](https://www.j)”,  
“breadcrumb”: “https:// › products › cloud-backup”  
},

---

<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:** [November 19, 2024, 1:42am UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/5 "2024-11-19T01:42:09Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/3/83581f39bdc5fd59dd80d02ce425190c2a4e6c30.png)

Does this look correct to you?

Sample data:

```auto
{
  "status": "ok",
  "result": 1,
  "data": {
    "tool name": "Rank Checker",
    "data": [
      {
        "type": "organic",
        "rank_group": 1,
        "rank_absolute": 1,
        "domain": "xx",
        "title": "Loop Backup AI – Cloud To Cloud Backup [Free Assisted …",
        "description": "Loop Backup uses immutable air gapped cloud storage and run by artificial intelligence with our money back guarantee if you are unable to restore your cloud …",
        "url": "https://xx",
        "breadcrumb": "https://xx"
      },
      {
        "type": "organic",
        "rank_group": 2,
        "rank_absolute": 2,
        "domain": "www.",
        "title": "Cloud Backup - Loop",
        "description": "Unlimited cloud backup for all your memories! Shipping information.",
        "url": "https://www.j",
        "breadcrumb": "https:// › products › cloud-backup"
      },
      {
        "type": "organic",
        "rank_group": 3,
        "rank_absolute": 3,
        "domain": "xx",
        "title": "AI-Powered Backup Solutions for Modern Businesses",
        "description": "Discover cutting-edge AI-powered backup solutions designed for seamless data protection and retrieval. Get peace of mind with automated workflows.",
        "url": "https://backup.ai",
        "breadcrumb": "https:// › solutions › ai-backup"
      },
      {
        "type": "organic",
        "rank_group": 4,
        "rank_absolute": 4,
        "domain": "xx",
        "title": "SecureCloud: Data Backup & Recovery Services",
        "description": "Secure your data with our reliable backup and recovery services. Trusted by professionals to safeguard business-critical information.",
        "url": "https://securecloud.com",
        "breadcrumb": "https:// › services › data-backup"
      },
      {
        "type": "organic",
        "rank_group": 5,
        "rank_absolute": 5,
        "domain": "www.",
        "title": "CloudProtector – Affordable Backup for Everyone",
        "description": "CloudProtector offers affordable, user-friendly backup solutions for individuals and small businesses. Start your free trial today!",
        "url": "https://cloudprotector.net",
        "breadcrumb": "https:// › plans › affordable-backup"
      }
    ]
  }
}

```

Query:

```auto
$join(
  data.data[domain = "xx"].(
    domain & '=' & rank_absolute
  ),
  ", "
)

```

You can build out the template for querying with a template column.

---

<div class="post-metadata">

**Author:** ![Craig\_Laird\_Jamieson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/craig_laird_jamieson/32/73155_2.png) [@Craig\_Laird\_Jamieson](https://community.glideapps.com/u/Craig_Laird_Jamieson)\
**Post date:** [November 19, 2024, 3:46pm UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/6 "2024-11-19T15:46:22Z")

</div>

Hi

Thanks for your help, it’s working perfectly.

Regards

Craig

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [November 26, 2024, 3:47pm UTC](https://community.glideapps.com/t/reference-a-field-in-a-json-query/77892/7 "2024-11-26T15:47:01Z")

</div>

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