Pass List of Dictionaries from Integration to CDT Process Variable

I have an ER that returns a list of dictionaries from an Integration. I'd like to pass this list of dictionaries into a CDT process variable. However, when I use the ER to create an activity class parameter to get the desired output for that process model node, it only returns one dictionary instead of all dictionaries. 

When I check the Array boxes for each field in the CDT, or check the 'Multiple' box for the process variable, I get the following error:   

An error occurred while evaluating expression: =pv!GridList.id (Invalid index: Cannot index property 'id' of type Text into null value of type Grid_CDT?list) (Data Inputs)

Please let me know if you have any ideas to solve this.

  Discussion posts and replies are publicly visible

Parents
  • An error occurred while evaluating expression: =pv!GridList.id (Invalid index: Cannot index property 'id' of type Text into null value of type Grid_CDT?list) (Data Inputs)

    • That means that you are sending a NULL value into your process model. And remember, you are passing multiple items also.
      • Make sure that you check Multiple in Process Parameters for pv!GridList
    • Also, maybe checking the value for gridList if it is empty or null before using it.

    Why don't you perform the transformation inside the expression that calls the integration and convert the dictionary into CDT format before passing to Process instead?

    with (
        local!integrationValues: rule!XXX_myIntegration(),
        local!formattedResponse: a!foreach(
            items: local!integrationValues, /*** ASSUMING THIS IS A DICT ***/
            /*** THIS CONVERTS YOUR INTEGRATION TO CDT FORMAT IN PROCESS ***/
            expression: rule!XXX_createIntegrationCdt(
                cdt: fv!item  
            )
        ),
        a!startProcess(
            processModel: "*** NAME OF PROCESS MODEL ***",
            processParameters: {
                integrationCdt: local!formattedResponse
            },
            onSuccess: {
            },
            onError: {
            }
        )
    )

Reply
  • An error occurred while evaluating expression: =pv!GridList.id (Invalid index: Cannot index property 'id' of type Text into null value of type Grid_CDT?list) (Data Inputs)

    • That means that you are sending a NULL value into your process model. And remember, you are passing multiple items also.
      • Make sure that you check Multiple in Process Parameters for pv!GridList
    • Also, maybe checking the value for gridList if it is empty or null before using it.

    Why don't you perform the transformation inside the expression that calls the integration and convert the dictionary into CDT format before passing to Process instead?

    with (
        local!integrationValues: rule!XXX_myIntegration(),
        local!formattedResponse: a!foreach(
            items: local!integrationValues, /*** ASSUMING THIS IS A DICT ***/
            /*** THIS CONVERTS YOUR INTEGRATION TO CDT FORMAT IN PROCESS ***/
            expression: rule!XXX_createIntegrationCdt(
                cdt: fv!item  
            )
        ),
        a!startProcess(
            processModel: "*** NAME OF PROCESS MODEL ***",
            processParameters: {
                integrationCdt: local!formattedResponse
            },
            onSuccess: {
            },
            onError: {
            }
        )
    )

Children
No Data