Sign InSign Up

Rocketbot Forum

Rocketbot Forum Logo Rocketbot Forum Logo

Rocketbot Forum Navigation

  • Academy Rocketbot
  • Tutorials
  • Documentación
Search
Ask A Question

Mobile menu

Close
  • Home
  • Popular
  • Categories
  • Tags
  • Questions
    • New Questions
    • Most voted
    • Most visited
    • Most Responded
  • Academy Rocketbot
  • Tutorials
  • Documentación
Home/ Questions/Q 6540
Next
In Process

Rocketbot Forum Latest Questions

pablomorales
  • 0
  • 0
pablomorales
Asked: February 15, 20222022-02-15T14:20:43+00:00 2022-02-15T14:20:43+00:00In: Academy

Lectura de json anidado

  • 0
  • 0

Hola, tengo el siguiente JSON en una variable y rocketbot al parecer no reconoce bien con los array y json anidados, por lo que no puedo trabajar.
basicamente quiero obtener el id en result pero no puedo extraer «results» de del json padre
{
«results»: [
{
«id»: 143254813621,
«code»: «»,
«code_name»: null,
«title»: «SAC XXX»,
«parent_id»: null,
«active»: true,
«case_state_summary»: null,
«url»: null,
«creator_id»: 7,
«created_at»: «2022-02-14T18:26:13.000Z»,
«updated_at»: «2022-02-14T18:26:13.000Z»,
«last_movement_official_date»: null
}
],
«pagination»: {
«count»: 1,
«per_page»: 100,
«current_page»: 1
}
}

json array
1
  • 1 1 Answer
  • 6k Views
  • 0 Followers
  • 0
Share
  • Facebook

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. Bender
      Bender
      2022-02-15T18:33:08+00:00Added an answer on February 15, 2022 at 6:33 pm
      This answer was edited.

      Hola pablomorales,

      Es por el valor null, true también te dará error, puedes realizarlo de estas 2 formas:

      1.- Con el comando Execute Python, realiza lo siguiente:

      null = None
      true = True
      id = {tu_var}['results'][0]['id']
      SetVar('id', id)

      Eso enviará el valor de la variable id del script a la variable id de rocketbot

      2.- Con Set Variable realiza esto:

      """{tu_var}""".replace('null', "'null'").replace('true', "'True'")

      Y ya con eso puedes trabajar los datos

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.


    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Ask A Question

    Stats

    • Questions : 1k
    • Answers : 2k
    • Posts : 0
    • Comments : 0
    • Best Answers : 163
    • Users : 5k
    • Popular
    • Comments
    • Tags

    Related Questions

      • Answer: 1

      Error al iniciar Rocketbot

      • Answers: 0

      Error al conectar a BD oracle

      • Answers: 4

      error al ahcer click en objeto

      • Answers: 3

      Without access to Academy Rocketbot and its courses

      • Answers: 3

      Bot final Level 2

    Users

    Explore

    • Home
    • Popular
    • Categories
    • Tags
    • Questions
      • New Questions
      • Most voted
      • Most visited
      • Most Responded

    Footer

    rocketbot white

    Rocketbot SpA | Todos los derechos reservados 2018 - 2020

    © 2020 Discy. All Rights Reserved
    With Love by 2code.

    en_US
    es_ES en_US

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.