JSON column formatting – reference column not in view

Hi we have Sharepoint online site using old template and switched list to use modern experience.

Problem is with JSON formatting, because some things do not work as expected.

  1. Unable to use/reference any site column in fashion [$ CustomColumnName] which are not used in the view. Error given is: Failure: CustomColumnName was not found on the data object.

  2. Referencing column [$ ID] gives two possible errors: empty like there is no data or Failure: Cannot read property ‘valueOf’ of null

I have tested out of the box examples from Microsoft site and many more and the behaviour is the same.

Does it have to do something that the site is not completely on modern design? Did you experienced this? Thanks

Linking also the same issue somebody else created, I have same behaviour. https://github.com/SharePoint/sp-dev-column-formatting/issues/19

Limitar resultados de datos Json en tabla – PHP

Tengo la información Json de la siguiente forma en MySQL

{"adult":false,"backdrop_path":"/m67smI1IIMmYzCl9axvKNULVKLr.jpg",     "belongs_to_collection":{"id":10194,"name":"Toy Story Collection","poster_path":"/7G9915LfUQ2lVfwMEEhDsn3kT4B.jpg","backdrop_path":"/9FBwqcd9IRruEDUrTdcaafOMKUq.jpg"},     "budget":175000000,     "genres":[{"id":12,"name":"Adventure"},{"id":16,"name":"Animation"},{"id":35,"name":"Comedy"},{"id":10751,"name":"Family"},{"id":14,"name":"Fantasy"}],     "homepage":"https://www.pixar.com/feature-films-toy-story-4",     "id":301528,     "imdb_id":"tt1979376",     "original_language":"en",     "original_title":"Toy Story 4",     "overview":"Woody has always been confident about his place in the world and that his priority is taking care of his kid, whether that's Andy or Bonnie. But when Bonnie adds a reluctant new toy called \"Forky\" to her room, a road trip adventure alongside old and new friends will show Woody how big the world can be for a toy.",     "popularity":125.276,     "poster_path":"/w9kR8qbmQ01HwnvK4alvnQ2ca0L.jpg",     "production_companies":[{"id":2,"logo_path":"/wdrCwmRnLFJhEoH8GSfymY85KHT.png","name":"Walt Disney Pictures","origin_country":"US"},{"id":3,"logo_path":"/1TjvGVDMYsj6JBxOAkUHpPEwLf7.png","name":"Pixar","origin_country":"US"}],"production_countries":[{"iso_3166_1":"US","name":"United States of America"}],     "release_date":"2019-06-19",     "revenue":519802847,     "runtime":100,     "spoken_languages":[{"iso_639_1":"en","name":"English"}],     "status":"Released",     "tagline":"Get Ready to Hit the Road",     "title":"Toy Story 4",     "video":false,     "vote_average":7.6,     "vote_count":2580,     "credits":{"cast":[{"cast_id":6,"character":"Woody (voice)","credit_id":"577a78b8c3a368770400058f","gender":2,"id":31,"name":"Tom Hanks","order":0,"profile_path":"/xxPMucou2wRDxLrud8i2D4dsywh.jpg"},{"cast_id":66,"character":"Buzz Lightyear (voice)","credit_id":"5c6d12ad92514129a2035517","gender":2,"id":12898,"name":"Tim Allen","order":1,"profile_path":"/PGLz0YLg4eB49BA6QxzHF5czxX.jpg"},{"cast_id":58,"character":"Bo Peep (voice)","credit_id":"5c6d12aa9251417df40bff9f","gender":1,"id":8873,"name":"Annie Potts","order":2,"profile_path":"/eryXT84RL41jHSJcMy4kS3u9y6w.jpg"},{"cast_id":63,"character":"Jessie (voice)","credit_id":"5c6d12ac9251412fc40f59a2","gender":1,"id":3234,"name":"Joan Cusack","order":3,"profile_path":"/3jcrXcFYoSKEUvokzqrQ2UJGtw.jpg"},{"cast_id":71,"character":"Forky (voice)","credit_id":"5c6d12aec3a3683bf0df729a","gender":2,"id":25147,"name":"Tony Hale","order":4,"profile_path":"/ar4uapp4w5wMkThZcqWUNMSTO8z.jpg"},{"cast_id":55,"character":"Duke Caboom (voice)","credit_id":"5c6d12aa9251412fc40f599b","gender":2,"id":6384,"name":"Keanu Reeves","order":5,"profile_path":"/bOlYWhVuOiU6azC4Bw6zlXZ5QTC.jpg"},{"cast_id":60,"character":"Ducky (voice)","credit_id":"5c6d12ab9251412fc40f599f","gender":2,"id":298410,"name":"Keegan-Michael Key","order":6,"profile_path":"/gqPRozx8ppAg2TSjW3ww56LnIZr.jpg"},{"cast_id":57,"character":"Bunny (voice)","credit_id":"5c6d12aa9251417aa20c2425","gender":2,"id":291263,"name":"Jordan Peele","order":7,"profile_path":"/9rOEfvKUInuUpJ6MMhiC8Tch1WM.jpg"},{"cast_id":92,"character":"Gabby Gabby (voice)","credit_id":"5c918de10e0a2612f55c3d1c","gender":1,"id":110014,"name":"Christina Hendricks","order":8,"profile_path":"/fqQWrKDhOTAPjjNTHSU4tBfq5NJ.jpg"},{"cast_id":93,"character":"Giggle McDimples (voice)","credit_id":"5c918dff0e0a2612ef5c5d78","gender":1,"id":209596,"name":"Ally Maki","order":9,"profile_path":"/fZK27EmQkDTtUayLX38XhLBZE9h.jpg"},{"cast_id":94,"character":"Mr. Potato Head (voice)","credit_id":"5c9cf99792514124c5312c59","gender":2,"id":7167,"name":"Don Rickles","order":10,"profile_path":"/h5BcaDMPRVLHLDzbQavec4xfSdt.jpg"},{"cast_id":73,"character":"Slinky Dog (voice)","credit_id":"5c6d12af92514129d503c75f","gender":2,"id":21485,"name":"Blake Clark","order":11,"profile_path":"/j6nhwuLKJXzHuD4zv2d3y99PcIC.jpg"},{"cast_id":62,"character":"Rex (voice)","credit_id":"5c6d12ac0e0a262c999fb6d5","gender":2,"id":12900,"name":"Wallace Shawn","order":12,"profile_path":"/oGE6JqPP2xH4tNORKNqxbNPYi7u.jpg"},{"cast_id":68,"character":"Hamm (voice)","credit_id":"5c6d12ad0e0a260e9e9b90e3","gender":2,"id":7907,"name":"John Ratzenberger","order":13,"profile_path":"/oRtDEOuIO1yDhTz5dORBdxXuLMO.jpg"},{"cast_id":72,"character":"Mrs. Potato Head (voice)","credit_id":"5c6d12af0e0a261aaf9f52f9","gender":1,"id":61964,"name":"Estelle Harris","order":14,"profile_path":"/equDBtZgBkO7e8QKpNokDz9EbY9.jpg"},{"cast_id":75,"character":"Squeeze Toy Aliens (voice)","credit_id":"5c6d12afc3a3685cbddee043","gender":2,"id":7882,"name":"Jeff Pidgeon","order":15,"profile_path":"/yLddkg5HcgbJg00cS13GVBnP0HY.jpg"},{"cast_id":59,"character":"Mr. Pricklepants (voice)","credit_id":"5c6d12ab92514129a2035514","gender":2,"id":10669,"name":"Timothy Dalton","order":16,"profile_path":"/n7QJKtA7jTwGHVuL5cPkqzu7CDG.jpg"},{"cast_id":61,"character":"Trixie (voice)","credit_id":"5c6d12ab0e0a266dacabaf13","gender":1,"id":109869,"name":"Kristen Schaal","order":17,"profile_path":"/rn84XtsczLSvJOWWNXLocaLx2df.jpg"},{"cast_id":70,"character":"Buttercup (voice)","credit_id":"5c6d12aec3a3684f97eb1407","gender":2,"id":60074,"name":"Jeff Garlin","order":18,"profile_path":"/cBs7u7rBTvDFp5MFCnvrPeF7SI2.jpg"},{"cast_id":65,"character":"Dolly (voice)","credit_id":"5c6d12ac0e0a260e9e9b90dc","gender":1,"id":5149,"name":"Bonnie Hunt","order":19,"profile_path":"/uKAfrFRZYnHFAxw53Jldbs8yIZO.jpg"},{"cast_id":74,"character":"Chuckles the Clown (voice)","credit_id":"5c6d12af0e0a261aaf9f52fc","gender":2,"id":7918,"name":"Bud Luckey","order":20,"profile_path":"/pcCh7G19FKMNijmPQg1PMH1btic.jpg"},{"cast_id":103,"character":"Bonnie (voice)","credit_id":"5d066a8092514104c4bba1c0","gender":1,"id":1530558,"name":"Madeleine McGraw","order":21,"profile_path":"/wrnJbVuxcEzmsU5FukVnFmS54Xo.jpg"},{"cast_id":96,"character":"Bonnie’s Dad (voice)","credit_id":"5d06691a92514163d1bfb253","gender":2,"id":19487,"name":"Jay Hernandez","order":22,"profile_path":"/phKVHS0PEAoWxqiYDJKL2K82ZX0.jpg"},{"cast_id":106,"character":"Andy Davis (voice)","credit_id":"5d0a59a30e0a2628abccec25","gender":2,"id":1116442,"name":"John Morris","order":23,"profile_path":"/vYGyvK4LzeaUCoNSHtsuqJUY15M.jpg"},{"cast_id":64,"character":"Mrs. Davis (voice)","credit_id":"5c6d12acc3a3685cbddee040","gender":1,"id":12133,"name":"Laurie Metcalf","order":24,"profile_path":"/oHhTbuv9eNJV4YlgizhCkZsPV0N.jpg"},{"cast_id":56,"character":"Harmony’s Mom (voice)","credit_id":"5c6d12aac3a368745eeca074","gender":1,"id":4687,"name":"Patricia Arquette","order":25,"profile_path":"/2ZIZ2xIdWKZNKRcdIe60AH25c82.jpg"},{"cast_id":69,"character":"Julia Anderson (voice)","credit_id":"5c6d12ae0e0a261aaf9f52f6","gender":1,"id":24358,"name":"Lori Alan","order":26,"profile_path":"/mNfJWzuaKgkIaK7CuirXOMosd2h.jpg"},{"cast_id":95,"character":"Axel the Carnie (voice)","credit_id":"5d0668939251413f2dbdb061","gender":2,"id":19278,"name":"Bill Hader","order":27,"profile_path":"/3Z5JsyLw7YTLZgpA3FAlLmFSN9F.jpg"},{"cast_id":97,"character":"Melephant Brooks (voice)","credit_id":"5d06694792514163d1bfb2bc","gender":2,"id":14639,"name":"Mel Brooks","order":28,"profile_path":"/ndFo3LOYNCUghQTK833N1Wtuynr.jpg"},{"cast_id":98,"character":"Bitey White (voice)","credit_id":"5d0669640e0a260b0ad139af","gender":1,"id":71727,"name":"Betty White","order":29,"profile_path":"/mgajnHMGottmiuwOeIRicx9BzbD.jpg"},{"cast_id":99,"character":"Combat Carl (voice)","credit_id":"5d0669a80e0a260b0ad139de","gender":2,"id":1101,"name":"Carl Weathers","order":30,"profile_path":"/xOpDfVa83R1EdiNkWPNITfCH67e.jpg"},{"cast_id":100,"character":"Chairol Burnett (voice)","credit_id":"5d0669dc0e0a261357d0f1c9","gender":1,"id":14837,"name":"Carol Burnett","order":31,"profile_path":"/uUN23A8WtaLcItllwFADuyqF8Ci.jpg"},{"cast_id":101,"character":"Carl Reineroceros (voice)","credit_id":"5d066a180e0a260eddcd7316","gender":2,"id":1895,"name":"Carl Reiner","order":32,"profile_path":"/AtDqJQkl7dH2m19kPio3cosfbes.jpg"},{"cast_id":102,"character":"Margaret the Store Owner (voice)","credit_id":"5d066a4f0e0a266424cb6274","gender":1,"id":35515,"name":"June Squibb","order":33,"profile_path":"/2QDE0wZ9B9a4Kd2S4e9XP65agrf.jpg"},{"cast_id":104,"character":"Old Timer (voice)","credit_id":"5d066a9c0e0a26511fcb14c4","gender":2,"id":24320,"name":"Alan Oppenheimer","order":34,"profile_path":"/5UAa7wSnoh6JwiAKciCCKB9dnro.jpg"},{"cast_id":105,"character":"Duke Caboom Advert (voice)","credit_id":"5d066b9f9251413f2dbdb4d2","gender":2,"id":1237,"name":"Flea","order":35,"profile_path":"/3mvSPp8RpuuPJUuNwq9PyjFu2Ug.jpg"},{"cast_id":108,"character":"Karen Beverly (voice)","credit_id":"5d0f9cfd9251417099bdd65b","gender":0,"id":1695631,"name":"Melissa Villaseñor","order":36,"profile_path":"/144VoO4M5sU0Mn4lpTOYQFAgNVO.jpg"}], 

Con la ayuda de uno de los usuarios de este grupo que me facilito este código extraigo todos los resultados de “cast”

$  movie = json_decode($  datos_movies); $  allNames = implode(" / ",array_column($  movie->credits->cast, 'name')); echo $  allNames; 

Teniendo como resultado

Tom Hanks / Tim Allen / Annie Potts / Joan Cusack / Tony Hale / Keanu Reeves / Keegan-Michael Key / Jordan Peele / Christina Hendricks / Ally Maki / Don Rickles / Blake Clark / Wallace Shawn / John Ratzenberger / Estelle Harris / Jeff Pidgeon / Timothy Dalton / Kristen Schaal / Jeff Garlin / Bonnie Hunt / Bud Luckey / Madeleine McGraw / Jay Hernandez / John Morris / Laurie Metcalf / Patricia Arquette / Lori Alan / Bill Hader / Mel Brooks / Betty White / Carl Weathers / Carol Burnett / Carl Reiner / June Squibb / Alan Oppenheimer / Flea / Melissa Villaseñor

Ocupo de su ayuda de nuevo para limitar el resultado a los primeros 10 nombres que aparecen en el Json. Ejemplo:

Tom Hanks / Tim Allen / Annie Potts / Joan Cusack / Tony Hale / Keanu Reeves / Keegan-Michael Key / Jordan Peele / Christina Hendricks / Ally Maki

Muchas gracias por todos sus aportes.

How to parse JSON to return null as default if complex object empty/null/undefined?

Using HTTP Request to get SP item, having trouble parsing JSON to return anything for null object.

Can return null for an empty string column as shown below, how to do so for a more complex object like a lookup if no value selected?

{ "type": "object", "properties": {     "Area": {         "type": "object",         "properties": {             "Id": {                 "type": "integer"             }         }     },     "Package": {         "type": ["string","null"]     } } 

If object doesn’t exist in JSON output, can’t run logic against it (if null do this, else do that)

Extraer datos de Json desde PHP y obtener valores específicos del Json

Tengo la información Json de la siguiente forma en MySQL {“adult”:false,”backdrop_path”:”/m67smI1IIMmYzCl9axvKNULVKLr.jpg”,”belongs_to_collection”:{“id”:10194,”name”:”Toy Story Collection”,”poster_path”:”/7G9915LfUQ2lVfwMEEhDsn3kT4B.jpg”,”backdrop_path”:”/9FBwqcd9IRruEDUrTdcaafOMKUq.jpg”},”budget”:175000000,”genres”:[{“id”:12,”name”:”Adventure”},{“id”:16,”name”:”Animation”},{“id”:35,”name”:”Comedy”},{“id”:10751,”name”:”Family”},{“id”:14,”name”:”Fantasy”}]}}

Para Extraer backdrop_path utilizo el siguiente código

echo json_decode($  datos_movies, true)["backdrop_path"]; 

ocupo extraer la información de las categorias y que se me muestre de la siguiente forma (Adventure / Animation / Comedy / Family / Fantasy).

Si lo hago con el mismo código me da como resultado Array

echo json_decode($  datos_movies, true)["genres"]; 

Ocupo de la ayuda para modificar el codigo y que me muestre la información completa (Adventure / Animation / Comedy / Family / Fantasy).

Saludos y gracias.

Cómo cargar un json desde la memoria del teléfono e iterarlo luego con Javascript en Phonegap (Córdova)

Perdonen que no muestro código pues a la verdad es que no lo tengo hasta ahora, he leído un poco sobre localStorage y el plugin cordova-plugin-file pero a decir verdad no acabo de comprender cómo hacer lo que quiero, si alguien sería tan amable de mostrarme un ejemplo de:

1- Acceder al Browser de archivos de Android para buscar el fichero que el usuario habría descargado previamente a la carpeta de los documentos del teléfono.

2- Este archivo que se quiere cargar y procesar es un JSON que va a contener noticias o artículos.

3- Se cómo procesar ese JSON y llevarlo a un loop en HTML con todos los objetos que traiga

4- Lo que necesitas es saber cómo lo puedo cargar

how to utilize if condition in Link for JSON column formatting in Sharepoint?

I am trying to remove all of “AAA” links from a link column called “LinkList” using JSON column formatting.

“AAA” is a link not txt. I am in trouble to hide all of this kind of cells in that column.

Tried some coding, but most of them hide all this column or just made some links unavailable. Please help me. Thanks!

{   "$  schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",   "elmType": "a",   "txtContent": "@currentField.desc",   "attributes": {     "href": "=if("LinkList"==[$  AAA], ‘hide’ , '’)",     "Target": "_blank"   } } 

journalctl json output breaking python’s json parser

ubuntu 19.04 python 3.7

Create a json file:

journalctl -ojson -r > a.json 

Now read it in :

with open('a.json') as infile :    data = json.load(infile)  Traceback (most recent call last):   File "journalctl.json.py", line 4, in <module> data = json.load(infile)   File "/usr/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)   File "/usr/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s)   File "/usr/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 985) 

And here’s line #2

{"_HOSTNAME":"vaio","_CAP_EFFECTIVE":"3fffffffff","_SELINUX_CONTEXT":"unconfined\n","_COMM":"anacron","_SYSTEMD_UNIT":"anacron.service","MESSAGE":"Normal exit (0 jobs run)","_SOURCE_REALTIME_TIMESTAMP":"1570415470605362","SYSLOG_FACILITY":"9","_BOOT_ID":"06344b4eb91344bf8c1ce7c49f77ee5d","_UID":"0","PRIORITY":"5","__CURSOR":"s=2b70948bafe3422ca5fa14213e18cda1;i=3c78c;b=06344b4eb91344bf8c1ce7c49f77ee5d;m=83ae2587;t=59448d8467447;x=24f85cc398f54cab","_PID":"22196","SYSLOG_IDENTIFIER":"anacron","_SYSTEMD_INVOCATION_ID":"3cc36dc0214b4f98a311fc110648019e","__MONOTONIC_TIMESTAMP":"2209228167","_CMDLINE":"/usr/sbin/anacron -d -q -s","_SYSTEMD_CGROUP":"/system.slice/anacron.service","_MACHINE_ID":"dc7bf55ee6014b7db63fba929237b2c9","_TRANSPORT":"syslog","_GID":"0","SYSLOG_TIMESTAMP":"Oct  6 19:31:10 ","__REALTIME_TIMESTAMP":"1570415470605383","_EXE":"/usr/sbin/anacron","SYSLOG_PID":"22196","_SYSTEMD_SLICE":"system.slice"} 

Mostrar los valores del JSON segun lo introducido en el input

Tengo una tabla donde visualizo los datos de un JSON y mi objetivo es mostrar solo los datos según lo que introduzca en los inputs, que es latitud y longitud y si eso valores coinciden con la latitud y la longitud de una ciudad del JSON, pues mostrar todo lo demás, id, ubicación… He visto NgIf y NgTemplate, pero soy novato en Angular todavía. Estos son los datos del json.

Codigo app.component.html:

<h1>{{Titulo}}</h1>  <div> <form [formGroup]="coordenadas" (ngSubmit) = "enviarDatos(coordenadas.value)" >     <input type="text" class="fortextbox" name="latitud" placeholder="Introduce una latitud"        formControlName="latitud">     <br/>      <input type="text" class="fortextbox" name="longitud" placeholder="Introduce una longitud"        formControlName="longitud">     <br/>      <input type="submit" class="forsubmit" value="Enviar"> </form> </div>   <pre *ngIf="datosCargados"> <table>   <thead>     <th>Id</th>     <th>Ubicación</th>     <th>Latitud</th>     <th>Longitud</th>     <th>T.mínima </th>     <th>T.máxima</th>   </thead>   <tbody>     <tr *ngFor="let datos of datosCargados">       <td>{{datos.id}}</td>       <td>{{datos.ubicacion}}</td>       <td>{{datos.latitud}}</td>       <td>{{datos.longitud}}</td>       <td>{{datos.temperaturamin}}</td>       <td>{{datos.temperaturamax}}</td>     </tr>   </tbody> </table> </pre> <h3 *ngIf="!datosCargados">No hay datos cargados</h3>