Whats the value of Row Apath ?

Created on 24 June 2023, about 1 year ago
Updated 25 November 2023, 8 months ago

Problem/Motivation

Whats the value of Row Apath?

Steps to reproduce

I'm not a developer, i'm a site builder enthusiasts. May be this is a very basic question for you.

I have two drupal site, let say drupal1 and drupal2.

In my drupal1 i have setup a view with json rest export. This is the output from https://domain.com/link-to-json-output like this:

[
  {
    "tahun": "2021",
    "name": "197704092010011008"
  },
  {
    "tahun": "2021",
    "name": "197704092010011008"
  },
  {
    "tahun": "2021",
    "name": "198103112010011013"
  },
  {
    "tahun": "2021",
    "name": "198009032009012004"
  },
  {
    "tahun": "2021",
    "name": "198009032009012004"
  }
]

In drupal2 i want to display the json data via views_json_source module.
I setup i views with paramater like this in Query Options:

JSON File: https://domain.com/link-to-json-output
Row Apath: /

with serveral
JSON: JSON Field: tahun
JSON: JSON Field: name

Bu Nothing show up and i got message "No query was run" in Views drupal2

Anyone please assist me how i can display those json to a view?

Is it possible to add contextual filter by "name"?

Hope anyone can help me.

Thanks before.

💬 Support request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇮🇩Indonesia tinohuda

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tinohuda
  • 🇸🇪Sweden arne_hortell

    Hi,

    First of all, might be a stupid question, but under advanced,->Query settings have you entered your url to site1 there?

    Now to the apath...
    In your case, i think you should use [
    I have the same json structure as you and it works fine with [

    the / is for when you have a single item as result and not a list/array which [ stands for.
    Hope something gets better for you.

  • 🇮🇩Indonesia tinohuda

    @arne_hortell

    Thank you, you saved my day, its work when i add end of URL with / and row apath with [

    Thnak you.

  • 🇸🇪Sweden arne_hortell

    My problem now is this

    {
    "alfa": "one",
    "beta": "two"
    }

    What in the world should the apath be???
    In my world, nothing, as its a single answer but i cant enter "nothing", its required something.

  • 🇮🇩Indonesia tinohuda

    Hi @arne_hortell

    is #5 solved?

    Anyone can help?

  • 🇺🇸United States jeppy64

    Hi,

    I have something similar. For me, simply using the opening curly for apath worked. "{" - no quotes
    Hope that works for you as it did for me.

  • Status changed to Closed: works as designed 8 months ago
  • 🇮🇳India venugopp Bangalore

    In case the response contains a single node(not an array), then use the settings "Response contain single node".
    This configurations is available in the Query settings.

Production build 0.69.0 2024