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

249
Views
Is there a function to find an expression and return the element ahead?

Good morning,

I would like to know if there is a specific function in javascript, which extracts from the message below only the value "141", after identifying the term "Temperatura.SaidaATM".

{ "d" : { "Temperature.ATM Output" : [141]

**Edit: The above package comes from sub MQTT in Json format.

The complete package is this below:

{"d":{"Temperature.ATM Output":[141]},"ts":"2021-12-18T13:28:34.964579"}

However I need to treat it to extract only the information between brackets "[xxx]", in the example above it is "141" but this value varies.

But I also need the quoted reference "Temperature.OutputATM".

Summing up: 1- The message "{"d":{"Temperature.OutputATM":[xxx]}"ts":"2021-12-18T13:28:34.964579"}" is received.

2- I need to extract the xxx from a javascript code

3- When reading "Temperatura.SaidaATM" in the message, return only what is in square brackets right after "[xxx]"

4- Final message return: xxx

Thank you in advance!

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

0

Yes. You have an object and you can select by key like that:

data = { "d" : { "Temperature.ATM Output" : [141] }}

console.log(data.d["Temperature.ATM Output"][0])

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!