Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
Javascript: JSON: Get value of a field

I have a JSON string as follows:

`

var json_string = 
[
{"ColumnName": "Column1", "Counts": 5, "Percentages": 30},
{"ColumnName": "Column2", "Counts": 10, "Percentages": 20},
{"ColumnName": "Column3", "Counts": 7, "Percentages": 40},
{"ColumnName": "Column4", "Counts": 45, "Percentages": 12},
{"ColumnName": "Column5", "Counts": 32, "Percentages": 32}
]

`

How do I get the value Column4's Counts value?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can do it like this: json_string[3]["Counts"] or json_string.find(a => a.ColumnName === "Column4").Counts;

about 4 years ago · Juan Pablo Isaza Report

0

You can do something like this... If you are sure Column4 exists

json_string.filter(a => a.ColumnName === "Column4")[0].Counts;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!