And still bothering you...

I'd like to get a list in the following form:

* Abri Fuchskirche
   ** Magdalenian
   ** Epigravettian
* Adlerowa
   ** Magdalenian
   ** Gravettian

The source json tiddler is:

{
  "type": "FeatureCollection",
  "features": [
    {
      "id": 445,
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          11.203903189,
          50.653401032
        ]
      },
      "properties": {
        "name": "Abri Fuchskirche",
        "site_id": 445,
        "cultures": [
          "Magdalenian",
          "Epigravettian"
        ],
        "elevation": 308
      }
    },
    {
      "id": 452,
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          16.749868297,
          49.242753593
        ]
      },
      "properties": {
        "name": "Adlerova",
        "site_id": 452,
        "cultures": [
          "Magdalenian",
          "Gravettian"
        ],
        "elevation": 371
      }
    }
  ]
}

thank you all for the help
Darek

środa, 23 września 2020 o 02:20:01 UTC+2 [email protected] napisał(a):

> This gets into "wikitext shortcuts" but you could simplify it with an 
> "trancluded filter" inside the list, wrapped in triple-curly-braces. TW 
> would be creating another widget in the background to handle transcluding 
> the final value.
> ```
> <$list filter="[[test]indexes[/cultures]addprefix[/cultures/]]" 
> variable="index">
>
> {{{ [[test]getindex<index>] }}}
>
> </$list>
> ```
>
> You could even use the $transclude widget like so:
>
> ```
> <$list filter="[[test]indexes[/cultures]addprefix[/cultures/]]" 
> variable="index">
>
> <$transclude tiddler="test" index=<<index>> />
>
> </$list>
> ```
>
> Best,
> Joshua Fontany
>
> On Tuesday, September 22, 2020 at 5:07:04 PM UTC-7 Joshua Fontany wrote:
>
>> Thanks Saq!
>>
>> Yes, you could with this list construction (note the additional slash 
>> when we add the prefix back to the index numbers):
>>
>> ```
>> <$list filter="[[test]indexes[/cultures]addprefix[/cultures/]]" 
>> variable="index">
>>
>> <$list filter="[[test]getindex<index>]">
>>
>> </$list>
>>
>> </$list>
>> ```
>>
>> Best,
>> Joshua F
>>
>> On Tuesday, September 22, 2020 at 1:53:14 PM UTC-7 Darek Bobak wrote:
>>
>>> Saq, thanks  for your help, the method works well. And would it be 
>>> possible to get all the values from the property which is not a single 
>>> value but array of the values. Cultures in the sample below:
>>>
>>> {
>>>         "name": "Pilszcz 64",
>>>         "region": "Silesia",
>>>         "country": "PL",
>>>         "site_id": 2,
>>>         "cultures": [
>>>           "Szeletian",
>>>           "Early Upper Palaeolithic"
>>>         ]
>>>       }
>>>
>>> cheers,
>>> Darek
>>>
>>> wtorek, 22 września 2020 o 12:21:02 UTC+2 [email protected] napisał(a):
>>>
>>>> @Darek
>>>>
>>>> I've never used jsonmangler so I am unsure if you can get this done in 
>>>> a singular expression.
>>>> I do think something like this should work if your JSON is in a tiddler 
>>>> called test
>>>>
>>>> <$list filter="[[test]indexes:all[]suffix[properties/name]]" 
>>>> variable="index">
>>>>
>>>> <$list filter="[[test]getindex<index>]">
>>>>
>>>> </$list>
>>>>
>>>> </$list> 
>>>>
>>>>
>>>> On Tuesday, September 22, 2020 at 11:21:57 AM UTC+2, Darek Bobak wrote:
>>>>>
>>>>>
>>>>> Is it possible to list all the values of the specified index in filter 
>>>>> expression? I would like to get all the values of the "name" (ie, 
>>>>> Albersdorf and Pfellnkofen) from the sample json tiddler:
>>>>>
>>>>> {
>>>>>   "type": "FeatureCollection",
>>>>>   "features": [
>>>>>     {
>>>>>       "type": "Feature",
>>>>>       "properties": {
>>>>>         "name": "Albersdorf",
>>>>>         "type": "Open",
>>>>>         "elevation": ""
>>>>>       },
>>>>>       "geometry": {
>>>>>         "type": "Point",
>>>>>         "coordinates": [
>>>>>           13.190206,
>>>>>           48.649078
>>>>>         ]
>>>>>       }
>>>>>     },
>>>>>     {
>>>>>       "type": "Feature",
>>>>>       "properties": {
>>>>>         "name": "Pfellnkofen",
>>>>>         "type": "Open",
>>>>>         "elevation": ""
>>>>>       },
>>>>>       "geometry": {
>>>>>         "type": "Point",
>>>>>         "coordinates": [
>>>>>           12.190206,
>>>>>           48.649078
>>>>>         ]
>>>>>       }
>>>>>     }
>>>>>   ]
>>>>> }
>>>>>
>>>>>
>>>>> best
>>>>> Darek
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/097d233c-6559-4d64-97d6-f1b4179626d7n%40googlegroups.com.

Reply via email to