Legacy Dev Forum Posts

 View Only

Sign Up

Flatten: Too many results matched criteria

  • 1.  Flatten: Too many results matched criteria

    Posted 06-05-2025 18:41

    rocco52 | 2018-10-10 14:18:15 UTC | #1

    Hello.

    I'm testing a Web Service Data Action, that consume a web service (using method GET) to obtain a long list of cities. But this response with this error:

    12. Flatten: Too many results matched criteria.

    { "status": 400, "code": "too.many.results", "message": "Too many results matched criteria.", "messageParams": {}, "contextId": "51dccdfd-8371-46ba-a89a-0a508c330022", "details": [], "errors": [] }

    There is a way to obtain this list?

    This is the output contract

    { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Salida", "description": "devuelve el listado de ciudades", "type": "array", "properties": { "nombreciudad": { "description": "Lista de las ciudades", "type": "string" }, "codigociudad": { "description": "Respuesta generada por el servicio – si es SI el servicio pudo obtener las ciudades NO el servicio no pudo obtener la lista de ciudades ", "type": "string" } } }


    Jason_Mathison | 2018-10-15 15:19:27 UTC | #2

    When a data action is set to flatten only one result is allowed. The idea being that if you are doing something like "Lookup a caller record in a CRM by phone number" it is easy to deal with exactly one match.

    What exactly are you trying to do with this large list of cities?


    rocco52 | 2018-10-18 22:51:55 UTC | #3

    Hello Jason

    I want to receive the list of cities to fill a dropdown (in script) dynamically.

    Other cuestion if I I can do this: fill the dropdown dinamically. For example: I receive five cities (name and Id), put this cities in the list of the dropdown.

    Thank you!


    Jason_Mathison | 2018-10-19 12:02:30 UTC | #4

    I would guess that what you want to do is use JsonPath in your translation map to take the list of cities names and turn that into a single array of names. I would typically take some example output from the web service and paste it into JsonPath.com to work out the JsonPath expression that I need.

    I can't really help you with populating a drop-down list as I have no experience with our scripting product. I would suggest starting with the documentation, and if that doesn't answer it, start a new thread in the PureCloud Applications -> Scripts room.


    tim.smith | 2018-10-19 13:02:58 UTC | #5

    You can populate the dropdown with variable values, but you can't dynamically fill a dropdown list with an unknown list of items. Scripts don't have array variables, so you would have to send variables like city1, city2, city3, etc. to the script and explicitly use the ones you've sent in the dropdown.


    system | 2018-11-19 13:03:00 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 3705