June 01, 2023, 01:09:10 PM
Welcome, Guest. Please login or register
News: Stay up to date with everything that's happening at http://twitter.digitalsignage.com

MediaSignage support forum



Author Topic: Modify JSON data  (Read 3731 times)

EbuscoSignage

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Modify JSON data
« on: September 17, 2020, 01:05:44 PM »
We retrieve data from another program . This contains names and the birthdays of our employees.
However... The program exports the birthday a day to early!

Meaning if the birthday is on by example 30-10-1955 (dd-mm-yyy), it gives us 29-10-1955

While I love getting cake a day earlier, it's not what we want of cos.
Unfortunately, there are some developments within the source program, that they're unable to address this issue on short notice.

The question now is: Can I adjust the data retrieved to add the day "+1"?
Perhaps it will be hard to do so, if we get a date like 31-08-xxxx to become 01-09-xxxx, but perhaps there is a way?
(Currently as it's setup in DSS, it is working fine but with the wrong date)


The (raw) data looks as followed:

{
  "Table": [
    {
      "ID": 1281,
      "DisplayName": "Jimmy Hendrix",
      "Birthday": "1955-09-29T00:00:00",
      "BirthdayString": "29-09-1955"
    },
    {
      "ID": 1390,
      "DisplayName": "Whoopie Goldberg",
      "Birthday": "1958-10-19T00:00:00",
      "BirthdayString": "19-10-1958"
    }
  ]
}

etc... for more employees


In a scene, I added the lines as followed:

$Table[0].BirthdayString" - "$Table[0].DisplayName"
$Table[1].BirthdayString" - "$Table[1].DisplayName"
$Table[2].BirthdayString" - "$Table[2].DisplayName
etc..."
« Last Edit: September 17, 2020, 02:03:57 PM by paul.roorda@ebusco.com »

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Modify JSON data
« Reply #1 on: September 17, 2020, 02:31:08 PM »
unfortunately, you cannot do filtering by date/time.  it does have filtering but only with text. even with text, you may get an erroneous on some dates

we assume that you are uploading the JSON file on some webserver - can the webserver run server side script and return JSON ?  if so, what you can do is to do filtering using the server's date/time so when the player pulls the data, it will only pull only with birthdays for the day. that said, you can simply create the original JSON file containing all birthdays for the month since the script will only return the day's celebrants.

best regards

-ADMIN

EbuscoSignage

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Modify JSON data
« Reply #2 on: September 17, 2020, 02:41:54 PM »
I'm not looking to filter anything. We do provide a JSON via a webserver page.
As mentioned, the problem is not showing the birthdays, but the data provided is 1 day off  (-1 day). We're not able to get that fixed on short term, so I was perhaps hoping DigitalSignageStudio is able to adjust the data.  (day +1)

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 5173
  • Karma: +36/-8
Re: Modify JSON data
« Reply #3 on: September 17, 2020, 10:04:16 PM »
unfortunately, the platform can only pull data and cannot do any operation on the data.

best regards

-ADMIN

EbuscoSignage

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Modify JSON data
« Reply #4 on: September 18, 2020, 08:36:06 AM »
Was already afraid of that answer. Thnx!  ;)

 

Carbonate design by Bloc
variant: carbon
SMF 2.0.12 | SMF © 2016, Simple Machines