• Resolved jocke92

    (@jocke92)


    Hi
    I have this code working to get data from one field, but I’m unable to get data from multiple fields.

    [jsoncontentimporter url= basenode=overview.lifeTimeData]{energy}[/jsoncontentimporter]

    I thought this should be possible, but that returns zero data.
    [jsoncontentimporter url= basenode=overview]{lifeTimeData.energy} {currentPower.power}[/jsoncontentimporter]

    JSON
    {"overview":{"lastUpdateTime":"2018-09-13 20:44:17","lifeTimeData":{"energy":292849.0},"lastYearData":{"energy":292849.0},"lastMonthData":{"energy":292849.0},"lastDayData":{"energy":40237.0},"currentPower":{"power":0.0},"measuredBy":"INVERTER"}}

    • This topic was modified 5 years, 7 months ago by jocke92.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    try

    [jsoncontentimporter url=http://wptest.kux.de/extra/json/jocke92.json basenode=overview]
    measuredBy: {measuredBy}
    lastUpdateTime: {lastUpdateTime}
    {subloop:lifeTimeData:-1}
    energy: {lifeTimeData.energy}
    {/subloop:lifeTimeData}
    [/jsoncontentimporter]

    Bernhard

    Thread Starter jocke92

    (@jocke92)

    Thanks, that worked.
    Am I able to do math with this plugin or pro version? I would like to divide my numbers by 1000

    • This reply was modified 5 years, 7 months ago by jocke92.
    Plugin Author berkux

    (@berkux)

    <<Am I able to do math with this plugin or pro version? I would like to divide my numbers by 1000>>
    For that you need the twig-parser, which is a pro plugin feature.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only getting data from one field’ is closed to new replies.