Visual Builder

Get Involved. Join the Conversation.

Topic

    dquesada
    Assing Variable TypeError: Cannot read property
    Topic posted August 20, 2019 by dquesada , tagged Action Flows, REST, Validation 
    21 Views, 2 Comments
    Title:
    Assing Variable TypeError: Cannot read property
    Summary:
    TypeError: Cannot read property 'cantidad' of undefined
    Content:

    Hi, i have a assign variable action, I am taking the result of a rest service and trying to map it to the screen variables

    but the result is a json that comes in the following format

    {

        "bOOrdenPedido.cantidad": "asd",

        "bOOrdenPedido.centroCostos": "asdasd",

        "bOOrdenPedido.costoUnidad": "asd",

        "bOOrdenPedido.detalle": "asd"

    }

     

    mapping is correct but at runtime it does not find the attribute,
    
    $chain.results.callRestEndpoint1.body.bOOrdenPedido.centroCostos/
    

     

    I think the error can be the marked
    

     

     

     

     

     

     

     

    Image:

    Comment

     

    • Shay Shmeltzer

      Is there a way for you to change the REST service so it won't return the . in the name?

      So instead of 

          "bOOrdenPedido.cantidad": "asd",

       

      have

          "bOOrdenPedidoCantidad": "asd",

       

      If not:

      Did you define your OrdernDePedido variable based on the endpoint using the wizard or did you define each field manually?

      I'm wondering if changing the structure of your destination object to be with another level would work:

      ordernDePedido->bOOrdenPedido->Cantidad

       

    • dquesada

      Hi Shay,  thanks for answering my questions, this rest service result is for  REST API for Oracle Integration,  i am getting the information of a process task, this task has all the information in a business object(bOOrdenPedido), i consuming this api https://docs.oracle.com/en/cloud/paas/integration-cloud/rest-api/op-ic-api-process-v1-tasks-id-payload-get.html