JSON

999

Solutions

910

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi Expert,
Can you help me to find out where i'm doing mistake or how to call this and also I used  newtonsoft

Following way i have tried to Deserialize Json. The results from REST services working fine
(candidateResults) i iwll get the data.

 var jcCandidate1 = JsonConvert.DeserializeObject<List<candidateDetails>>(candidateResults);

also i tried
 var jcCandidate1 = JsonConvert.DeserializeObject<List<candidateDetails>>(candidateResults);

Open in new window



all classes  created according to Json Results. (go to Edit special paste -> select Json)

namespace TestConsolApp
{
   
    public class candidateMain
    {
        public candidateDetails[] Property1 { get; set; }
    }

    public class candidateDetails
    {
        public string _id { get; set; }
        public DateTime creation_date { get; set; }
        public string email_address { get; set; }
        public string headline { get; set; }
        public string initial { get; set; }
        public string name { get; set; }
        public string origin { get; set; }
        public string phone_number { get; set; }
        public candidateResume resume { get; set; }
        public candidateSource source { get; set; }
        public candidateStage stage { get; set; }
        //public object[] tags { get; set; }
        public DateTime updated_date { get; set; }
    }

    public class candidateResume
    {
        public string url { get; set; }
    }

    public class candidateSource
    {
        public

Open in new window

0
Fundamentals of JavaScript
LVL 19
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Building on a previous question

How do I wait until new content has been loaded before adding to results?

In the code i'm just writing in SUDO so to illustrate

var imgs = document.querySelectorAll('.photo-item img');
var results = [];
var seconds = 0;
for (var i = 0; i < imgs.length; i++) {
    imgs[i].click();
    do {
        console.log('In Do loop Seconds: ' + seconds);
        if (document.querySelector('.gallery-full-imag') != null) {
            var BigImgs = document.querySelectorAll('.gallery-full-imag img');
            results.push({
            src: BigImgs[0].src,
                data: BigImgs[0].dataset.img
            });
            seconds = 10;
        }
        else {
            setTimeout(function () { seconds++; }, 1000);
          
        }
} while (seconds<10);

     document.querySelector('.gallery-fullscreen-hide').click();
}
var json = JSON.stringify(results);

Open in new window

0
Hi Experts,

I've tried to flatten the data in the json to have the mean of every "valeur" for each "cours".
I followed the instruction in: Flattening JSON objects
but can't seem to do it.

Is there  a solution to this?

Michael
Data.json
0
How can I make my text area editor disabled if the user typed in more than 4000 characters?

I have tried the disable syntax but it's not working


<link type="text/css" rel="stylesheet" href="~/Content/CWScss/jodit.min.css">
<script type="text/javascript" src="~/Scripts/jodit.min.js"></script>


 jQuery(function () {
            var maxLength4000 = 4000;
            $(document).on("keyup paste blur click touchend", function () {
                var textlen = maxLength4000 - $("#AttributesAndValue").val().length;

                 //Here I want to say if textlen more than 4000 char then disable my text editor 
                //my disable is not working 

                if ($("#AttributesAndValue").text().length == 4000 || textlen <= -1) {
                    $('#AttributesAndValue').prop("disabled", true);
                }


                $('#rchars').text(textlen);
            });
            $('#AttributesAndValue').each(function () {
                var AttributesAndValue = new Jodit(this);
                AttributesAndValue.setDisabled();
            });
        });


                  <div class="form-group purple-border">
                        Attribute(s) and Value(s)
                        @Html.TextArea("AttributesAndValue", new { @class = "form-control", @style = "width:77%" })
                          <div id="ValidateAttributesAndValue" style="color:#bc0606;font-weight:bold;">Required Field</div>
                        <span 

Open in new window

0
Hi experts,
I have following issue when i'm doing sharepoint 365 live  HTTP . I used parse Jason  in the work flow.
Any idea how to do that much appriciated

See below error message

InvalidJSON. The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value '<?xml version="1.0"?> <directory> <fieldset> <field id="displayName">Display name</field> <field id="firstName">First name</field> <field id="lastName">Last name</field> <field id="preferredName">Preferred name</field> <field id="gender">Gender</field> <field id="jobTitle">Job title</field> <field id="workPhone">Work Phone</field> <field id="workEmail">Work Email</field> <field id="department">Department</field> <field id="location">Location</field> <field id="division">Division</field> <field id="workPhoneExtension">Work Ext.</field> <field id="photoUploaded">Employee photo</field> <field id="photoUrl">Photo URL</field> <field id="canUploadPhoto">Can Upload Photo</field> </fieldset> <employees> <employee id="440"> <field id="displayName">Brendan Adams</field> <field id="firstName">Brendan</field> <field id="lastName">Adams</field> <field id="preferredName">Brendan</field> <field id="gender">Male</field> <field id="jobTitle">Production Supervisor</field> <field id="workPhone"></field>

When i'm trying to Postman  API out put looks like this

<?xml version="1.0"?>
<directory>
    <fieldset>
        <field id="displayName">Display name</field>
        <field id="firstName">First …
0
Given the snippet of html  how do I create a JSON string from each img with class = 'MyClass' to give both  src  and data-img

HTML
<h1>Hello world!</h1>


<div>
  <div class='MyClass'><img src='//image.tmdb.org/t/p/w185/fw02ONlDhrYjTSZV8XO6hhU3ds3.jpg' data-img=1234></div>
   <div class='MyClass'><img src='//image.tmdb.org/t/p/w185/fw02ONlDhrYjTSZV8XO6hhU3ds3.jpg' data-img=5678></div>
</div>

</div>
<div id='res'>

</div>

Open in new window


JavaScript
const obj = {};
obj.test = [];
var el = document.getElementsByClassName('MyClass');
alert('el len ' + el.length);
for (var i = 0; i < el.length; i++) {
    var src = el[i].getAttribute('src');
    var data = el[i].getAttribute('data-img');
    obj.test.src = src;
    obj.test.data = data;
}
const json = JSON.stringify(obj);
document.getElementById("res").innerHTML = json;

Open in new window


Here is a jsfiddle
0
I'm working my way through a couple of tutorials that walk you through how to create an API that retrieves Fitbit info. The content is great and every educational, but I'm stuck and I need some help.

First of all, I'm using  "fitbit-node" (https://github.com/lukasolson/fitbit-node). With that, I've been able to successfully retrieve "profile.json" which seems to be the starting point for any API.

The "app.js" that's included as part of the example, looks like this:

// initialize the express application
const express = require("express");
const app = express();

// initialize the Fitbit API client
const FitbitApiClient = require("fitbit-node");
const client = new FitbitApiClient({
	clientId: "22BD5D", //client_id
	clientSecret: "9677a6cdf63836e26d0617e9ac2c38f8", //client secret
	apiVersion: '1.2' // 1.2 is the default
});

// redirect the user to the Fitbit authorization page
app.get("/authorize", (req, res) => {
	// request access to the user's activity, heartrate, location, nutrion, profile, settings, sleep, social, and weight scopes
	res.redirect(client.getAuthorizeUrl('activity heartrate location nutrition profile settings sleep social weight', 'http://localhost:3000/callback')); //callback url
});

// handle the callback from the Fitbit authorization flow
app.get("/callback", (req, res) => {
	// exchange the authorization code we just received for an access token
	client.getAccessToken(req.query.code, 'http://localhost:3000/callback').then(result => { 

Open in new window

0
I'm working with a fully functional Node.js code that interacts with the Fitbit API.

Being somewhat new to Node, however, has me in a spot where I need a little guidance.

The code looks like this:

// initialize the express application
const express = require("express");
const app = express();

// initialize the Fitbit API client
const FitbitApiClient = require("fitbit-node");
const client = new FitbitApiClient({
	clientId: "CLIENT_ID", //client_id
	clientSecret: "CLIENT_SECRET", //client secret
	apiVersion: '1.2' // 1.2 is the default
});

// redirect the user to the Fitbit authorization page
app.get("/authorize", (req, res) => {
	// request access to the user's activity, heartrate, location, nutrion, profile, settings, sleep, social, and weight scopes
	res.redirect(client.getAuthorizeUrl('activity heartrate location nutrition profile settings sleep social weight', 'http://localhost:3000/callback')); //callback url
});

// handle the callback from the Fitbit authorization flow
app.get("/callback", (req, res) => {
	// exchange the authorization code we just received for an access token
	client.getAccessToken(req.query.code, 'http://localhost:3000/callback').then(result => { //callback url
		// use the access token to fetch the user's profile information
		[b]client.get("/profile.json", result.access_token)[/b]
		[u]//client.get ("/1/user/[user-id]/[resource-path]/date/[date]/[period].json", result.access_token)[/u]
		.then(results => {
			res.send(results[0]);

Open in new window

0
I'm using "npm fitbit-node" and I am poised on the threshold of great things!

Here's the "app.js" file and I've emboldened that section of the code that I've got a question about:

// initialize the express application
const express = require("express");
const app = express();

// initialize the Fitbit API client
const FitbitApiClient = require("fitbit-node");
const client = new FitbitApiClient({
	clientId: "CLIENT_ID", //client_id
	clientSecret: "CLIENT_SECRET", //client secret
	apiVersion: '1.2' // 1.2 is the default
});

// redirect the user to the Fitbit authorization page
app.get("/authorize", (req, res) => {
	// request access to the user's activity, heartrate, location, nutrion, profile, settings, sleep, social, and weight scopes
	res.redirect(client.getAuthorizeUrl('activity heartrate location nutrition profile settings sleep social weight', 'http://localhost:3000/callback')); //callback url
});

// handle the callback from the Fitbit authorization flow
app.get("/callback", (req, res) => {
	// exchange the authorization code we just received for an access token
	client.getAccessToken(req.query.code, 'http://localhost:3000/callback').then(result => { //callback url
		// use the access token to fetch the user's profile information
		[b]client.get("/profile.json", result.access_token)[/b]
		[u]//client.get ("/1/user/[user-id]/[resource-path]/date/[date]/[period].json", result.access_token)[/u]
		.then(results => {
			res.send(results[0]);
			

Open in new window

0
Dear Experts,
I use PHP,
I need to get a result inside an object which is inside Json.
I get the parrent result like below.

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec($ch);

var_dump ( $obj = json_decode($server_output));

echo $yeniobj= ($obj->result);

//Result is 
object(stdClass)#1 (10) { ["result"]=> string(90) "{"ReturnCode":0,"ReturnData":null,"Confirm":null,"TimeStamp":"04.11.2019 10:43:34"}" ["id"]=> int(135) ["exception"]=> NULL ["status"]=> int(5) ["isCanceled"]=> bool(false) ["isCompleted"]=> bool(true) ["isCompletedSuccessfully"]=> bool(true) ["creationOptions"]=> int(0) ["asyncState"]=> NULL ["isFaulted"]=> bool(false) }

echo $yeniobj= ($obj->result);

//Result is

{"ReturnCode":0,"ReturnData":null,"PaymentConfirm":null,"TimeStamp":"04.11.2019 10:43:34"}

Open in new window


But I need to result of the ReturnCode information.
How can I get that? thank you
0
Become a CompTIA Certified Healthcare IT Tech
LVL 19
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

https://jsfiddle.net/vx1991/vhn9jw2o/

Hi all, just trying to get the keys and values.

On line 8, Im using  Object.keys(item).forEach(function(key) {, but if I change it to  Object.entries(item).forEach(function(key) {

how do I get the keys and values?
0
Hi Expert,
Any one know how to change background  color in the List  using JSON
I have found using rows but not all the background and heading
For example :
{
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "color": "#fff",
    "padding-left": "10px",
    "background-color": {
      "operator": "?",
      "operands": [
        {
          "operator": "==",
          "operands": [
            "@currentField",
            "Green"
          ]
        },

Open in new window

0
Hi,

I am new to web development and c# and java script in particular.  I have a problem I have been stuck on for a few days.  I have a ASP Core project.  I have a button on a page that calls some javascript code to pass in a serial number and I want it to return some data from my controller.  There are several fields in my model data, but to keep it simple i will just try and show 2.  The problem is it is showing the serial number but any other field it shows the value as undefined when i load the page and press the button.

The java script I have is:
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>

    $(document).ready(function () {
        $("#abc").click(function (e) {
            if ($("#SerialNumber").val() == "")
                alert("SerialNumber cannot be empty");
            else if ($("#Comments").val() == "")
                alert("Comments cannot be empty");
            else {
                $.ajax({
                    type: "POST",
                    url: "/Home/GetSecuredData",
                    data: {"serialNumber": + $("#SerialNumber").val() },
                    success: function (result, status, xhr)
                    {
                        var html1 = ""
                         $.each(result, function (items, OperationsData)
                        {
                
                                html1 += `                                
                                       

Open in new window

0
How to access data in Json arrays in Ms Access, below is an example of a pure json with arrays, I have no problem when dealing with pure object value pairs:
Current code:
{
    "age": 45,
    "cars": [ {
        "model": "Audi A1", 
        "mpg": 15.1
    },
    {
        "model": "Zeep Compass", 
        "mpg": 18.1
    }
    ],
    "children":[ "Alice",
		  "Bob"
	],
    "married": true,
    "name": "Ken",
    "pets": [ 
		"Dog"
	]
}

Open in new window

How can I access “Alice”, “Bob” and “Ken”

For the current code I’m able to access or add all items to my table by doing something like below:
With rs
            .AddNew
            ![id] = item("id")
            ![firstName] = item("name")
            ![UserName] = item("username")
            ![email] = item("email")
            ![street] = item("address")("street")
            ![suite] = item("address")("suite")
            ![city] = item("address")("city")
            ![zipcode] = item("address")("zipcode")
            ![lat] = item("address")("geo")("lat")
            ![lng] = item("address")("geo")("lng")
            ![Phone] = item("phone")
            ![WebSite] = item("website")
            ![Company] = item("company")("name")
            ![catchPhrase] = item("company")("catchPhrase")
            ![bs] = item("company")("bs")
            .Update
        End With

Open in new window


Source Data:

{
    "id": 1,
    "name": "Leanne Graham",
    "username": "Bret",
    "email": "Sincere@april.biz",
    "address": {
      "street": "Kulas Light",
      "suite": "Apt. 556",
      "city": "Gwenborough",
      "zipcode": "92998-3874",
      "geo": {
        "lat": "-37.3159",
        "lng": "81.1496"
      }
    },
    "phone": "1-770-736-8031 x56442",
    "website": "hildegard.org",
    "company": {
      "name": "Romaguera-Crona",
      "catchPhrase": "Multi-layered client-server neural-net",
      "bs": "harness real-time e-markets"
    }
  },

Open in new window


My problem comes when arrays are involved , how is it done???????
Kindly regards

Chris
0
HI,
I have a react question. like the code below,

 const res = await fetch("getLayers"); // this calling db, I don't want to call db, I want to give a json file instead of call a service, how can I do it?
    if (res.ok) {
      const layers = await res.json();
      setOverlayLayers(layers.map(layer => ({ ...layer, key: getId() })));
    }

Open in new window

Any inputs are welcome.
0
Hi experts!  I'm new to JSON and have a nested JSON that is being sent to my API.  I've attached the JSON file as well as my PHP trying to collect the values for the various "types" of lines.  While my code does not return any errors, the values that get input to my table are all "zeros" except for the "code", "rpt" and "zip" fields.  Can you help me with the correct structure to collect this data?JSON-request.docxPHP-Code.docx
0
Hi,

I have lots of jsons which I d need to mass edit (add entries, remove, edit, based upon some logic).  F.e. if entry entry1.date.request is not existing add with value y etc
I d like to to this Powershell based. Also json validation needs to occur (syntax ok).

Maybe there is a tool also as backup/extra checks.

J
0
On receiving data from a Json format from the RS 232 COM, I seem to have some a bit of a challenge, I have no problem in sending
(1)      I’m not sure at what point the received data (In Json string) from the gadget will  looped into  or iterated until passed through the table , I cannot see the actual connection here, my maths does not seem to balance. Kindly see if you can spot something here.
Below is the code requiring checking , currently there no errors whatsoever , but the connection on how that data which will be received will looped into the database that is where I’m behind.

Code requiring your attention

Private Sub CmdEmp_Click()
    Dim json As Object
    Dim i As Integer
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim item As Object
    Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long
    Dim strError  As String
    Dim strData   As String
    Dim lngSize As Integer
    ' Read maximum of 64 bytes from serial port.
    lngStatus = CommRead(intPortID, strData, 64)
    If lngStatus > 0 Then
        ' Process data.
    ElseIf lngStatus < 0 Then
        ' Handle error.
    End If

    ' Reset modem control lines.
    lngStatus = CommSetLine(intPortID, LINE_RTS, False)
    lngStatus = CommSetLine(intPortID, LINE_DTR, False)

    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Contact")
    
    i = 2
    For Each item In json
        
        With rs
            .AddNew
            ![id] = 

Open in new window

0
Hi All;

Im having the same error messages when sending data and receiving Json string using RS 232, before I start working on the gadget I want a second eye to  take a look on the code below, please  note the following :

9600 baud is converted to 64 bytes

All the  two codes for sending & receiving as well as for converting received data are called from the main code that has the data for sending since once the data is received by the gadget then the gadget is supposed to send a signature back instantly.

Receiving code


Private Sub CmdTaxReceive_Click()
Dim strData As String
Dim lngStatus As Long
Dim strError As String
Dim intPortID As Integer
' Read maximum of 64 bytes from serial port.
    lngStatus = CommRead(intPortID, strData, 64)

If lngStatus > 0 Then
        ' Process data.
 ElseIf lngStatus < 0 Then
      lngStatus = CommGetError(strError)
      MsgBox "COM Error: " & strError
      Stop
    End If
    
    lngStatus = CommFlush(intPortID)
    
    If lngStatus <> 0 Then
      lngStatus = CommGetError(strError)
      MsgBox "COM Error: " & strError
      Stop
    End If
' Reset modem control lines.
    lngStatus = CommSetLine(intPortID, LINE_RTS, False)
    lngStatus = CommSetLine(intPortID, LINE_DTR, False)
 ' Close communications.
    Call CommClose(intPortID)

End Sub

Open in new window

Sending code


Private Sub CmdSendTax_Click()
Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long
    Dim strError  As String
    Dim strData   As String
    Dim lngSize As Long

    ' Initialize Communications
    lngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), _
        "baud=9600 parity=N data=8 stop=1")
    
    If lngStatus <> 0 Then
    ' Handle error.
        lngStatus = CommGetError(strError)
    MsgBox "COM Error: " & strError
    End If
 
    ' Set modem control lines.
    lngStatus = CommSetLine(intPortID, LINE_RTS, True)
    lngStatus = CommSetLine(intPortID, LINE_DTR, True)

    ' Write data to serial port.
    lngSize = Len(strData)
    lngStatus = CommWrite(intPortID, strData)
    If lngStatus <> lngSize Then
    ' Handle error.
    End If
End Sub

Open in new window



Calling them on the same form but on the main code


Call CmdTaxReceive_Click
Call CmdSendTax_Click
Call CmdEmp_Click

Open in new window



Where do I go wrong????



Auditing-tools.png


Blank-Invoices-Details.png
0
Why Diversity in Tech Matters
LVL 19
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Dear all Experts!
I would like to thank you all for assisting me to almost finish my task as assigned by management, and many special thanks to Mr Jim for providing the VBA code below for send & receiving data from & to RS232 com gadget
The last bit though not much is another assistance required to receive the data from RS 232 which is coming in Json format, I’m fully aware he also provided a form on the scale part, but this appear to be slightly different:
Functional VBA Code:
Option Compare Database
Option Explicit

'-------------------------------------------------------------------------------
' modCOMM - Written by: David M. Hitchner
'
' This VB module is a collection of routines to perform serial port I/O without
' using the Microsoft Comm Control component.  This module uses the Windows API
' to perform the overlapped I/O operations necessary for serial communications.
'
' The routine can handle up to 4 serial ports which are identified with a
' Port ID.
'
' All routines (with the exception of CommRead and CommWrite) return an error
' code or 0 if no error occurs.  The routine CommGetError can be used to get
' the complete error message.
'-------------------------------------------------------------------------------

'-------------------------------------------------------------------------------
' Public Constants
'-------------------------------------------------------------------------------

' Output Control Lines (CommSetLine)
Public Const LINE_BREAK = 1

Open in new window

0
I need to insert a collection called Tax Class within Json format/Ms access VBA code which is now almost complete see current results below:

Current results
{
   "PosSerialNumber": "102010",
   "IssueTime": "2019-09-15",
   "Customer": 1,
   "TransactionTyp": 0,
   "PaymentMode": 0,
   "SaleType": 0,
   "Items": [
      {
         "ItemID": 1,
         "Description": "Apple (Rgb 350 ML)",
         "BarCode": "6009803227328",
         "Quantity": 15,
         "UnitPrice": 41,
         "Discount": 0,
         "Taxable": [
            {
               "Total": 615,
               "IsTaxInclusive": "True",
               "RRP": 52.8
            }
         ]
      },

Open in new window


Expected results

{
   "PosSerialNumber": "102010",
   "IssueTime": "2019-09-15",
   "Customer": 1,
   "TransactionTyp": 0,
   "PaymentMode": 0,
   "SaleType": 0,
   "Items": [
      {
         "ItemID": 1,
         "Description": "Apple (Rgb 350 ML)",
         "BarCode": "6009803227328",
         "Quantity": 15,
         "UnitPrice": 41,
         "Discount": 0,
         "Taxable": [
              "B"
               ]
            {
               "Total": 615,
               "IsTaxInclusive": "True",
               "RRP": 52.8
            }
         ]
      },

Open in new window

Amendment required on VBA

How do I include the new collection ("tax category") in the below VBA to hold ["B"] just below "taxable"

Private Sub CmdSales_Click()
  
'  Const SQL_SELECT As String = 

Open in new window

0
hi am having error in my script
python mapView.py
Traceback (most recent call last):
  File "mapView.py", line 44, in <module>
    style_function=lambda x: {'fillColor':'yellow'}))
  File "C:\ProgramData\Anaconda3\lib\site-packages\folium\features.py", line 450, in __init__
    self.data = self.process_data(data)
  File "C:\ProgramData\Anaconda3\lib\site-packages\folium\features.py", line 494, in process_data
    ': {!r}'.format(data))
ValueError: Cannot render objects with any missing geometries: <_io.TextIOWrapper name='world.json' mode='r' encoding='utf-8-sig'>
this my script
import folium
import pandas


data = pandas.read_csv("Volcanoes.txt")
lat = list(data["LAT"])
lon = list(data["LON"])
elev = list(data["ELEV"])




def color_producer(elevetion):
    if elevetion < 1000:
        return  'green'
    elif 1000 <= elevetion < 3000:
        return 'orange'
    else:
        return 'red'	


#map = folium.Map(location=[lat, lon], zoom_start=6, tiles="Stamen Terrain")
#map = folium.Map(location=[lat[0], lon[0]], zoom_start=5, tiles="Stamen Terrain")

map = folium.Map(location=[38.58,-99.09], zoom_start=5, tiles="Mapbox Bright")

#map = folium.Map(location=[0, 0], zoom_start=6)



fg = folium.FeatureGroup(name="My Map")

#for lt,ln,el in zip(lat,lon,elev):
 #    fg.add_child(folium.Marker(location=[lt, ln],popup=str(el)+" m",icon=folium.Icon(color=color_producer(el)))
	 
for lt,ln,el in zip(lat,lon,elev):
     

Open in new window

0
Hi,

I have the following json_decode data :

Array
(
    [metadata] => Array
        (
            [result] => 1
            [version] => 1
            [command] => listzones
            [reason] => OK
        )

    [data] => Array
        (
            [zone] => Array
                (
                    [0] => Array
                        (
                            [zonefile] => mybrand.asia.db
                            [domain] => mybrand.asia
                        )

                    [1] => Array
                        (
                            [domain] => mybrand.my
                            [zonefile] => mybrand.my.db
                        )

                )

        )

)

Open in new window


May i know how to manipulate the data ?

Eg:

1. How to get "mybrand.asia" or "mybrand.my.db" output ?

2. How to loop each data in foreach ?


Appreciates anyone assistant on this.

Thank you.
0
Now after puting the Json string correct in VBA Ms Access I'm required to send that string to a fisical device attached to my laptop using access rs232 port with vba is there any way to send data to com port or listen to it

Kindly help me with VBA , I really need your help over this:

(1) Setting up the VBA to use rs232 port and send data to a fiscal device
0
How to make sure the string picks the underlying value from a form in ms access vba, see below, the Json format returned is what is required , the problem the actual values are notr picked:

Option Compare Database
Option Explicit
Private Sub Command0_Click()
Dim Json As Object
Dim vals As String
Set Json = JsonConverter.ParseJson(CStr("{""Customer"":"" & Me.txtCustmer & "",""Location"":["" & Me.txta & "" ,"" & Me.txtb & "",  "" & Me.txtc & "","" & Me.txtd & ""],"" & Me.txtk & "":{""Quantity"":"" & Me.txtg & ""}}"))

' Json("a") -> 123
' Json("b")(2) -> 2
' Json("c")("d") -> 456

MsgBox JsonConverter.ConvertToJson(Json, Whitespace:=3), vbOKOnly, "Audited by Chris Hankwembo"
End Sub

Open in new window



See screen shoot


Auditing-tools.png
If this is done then that is it I will have more control on this.
0

JSON

999

Solutions

910

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.