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

241
Views
Can not get values of an array from an object

I tried to get values from an array from an object but it doesn't work. Can someone help me.

Here is the JSON parse:

  let userContent = null;
  try {
    userContent = JSON.parse(entity.contactform_content);
  } catch (e) {
    userContent = String(userContent);
  }

Return:

"contactform_id": "118",
"contactform_content": 
"{\"display_name\":\"Peter\",\"user_email\":\"peter@gmail.com\",\"user_nation\":\"be\",
\"category\":[{\"name\":\"Chinese Astrology\",\"value\":\"Chinese Astrology\"},{\"name\":\"Karmic Astrology\",\"value\":\"Karmic Astrology\"},{\"name\":\"Horoscopes\",\"value\":\"Horoscopes\"}],
\"available_time\":\"4 hours\",
\"time_slot\":\"2 hours\"}",   
}

My attempt to get category value:

<TextField
autoComplete="off"
label="Category"
value={userContent.category}
/>

It doesn't show category values

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

0

Try this:

<TextField
  autoComplete="off"
   label="Category"
  value={userContent.category.map(x => x.name)}
/>

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!