Reference a field in a JSON Query

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

Hola!

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

Bye

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.

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”,
“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”
},

Does this look correct to you?

Sample data:

{
  "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:

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

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

1 Like

Hi

Thanks for your help, it’s working perfectly.

Regards

Craig

1 Like

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