We are trying to use RESTFUL service to send JSON data to Appian. The

Certified Senior Developer
We are trying to use RESTFUL service to send JSON data to Appian.

The parameter is defined of any type which is a CDT. So, in the expression rule based on 'messageid' shared in request header, the request detail will be sent in response.

= httppostwithresponse(
endpoint: URL(),
paramNames: {},
paramValues: {},
headerNames: { cons!HEADER },
headerValues: {
(
TraceId: "",
SourceIpAddress: "",
SourceHostName: "",
RelayedBy: "",
ApiVersion: "",
SessionId: "",
Originator: "",
UserRole: "",
OperationName: "",
processId: ""
)
},
body: "
{
          ""request"": {
                    ""gtwyReqHdr"": {
           ""TraceId"": ""String"",
""MessageId"": ""MESSAGE"",
""SourceIpAddress"": ""String"",
""SourceHostName"": ""String"",
""SourceTimestamp"": ""YYYY-DD-MM hh:mm:ss"",
""RelayedBy"": ""String"",
""ApiVersion"": ""String"",
...

OriginalPostID-180232

OriginalPostID-180232

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer
    ... ""SessionId"": ""String"",
    ""Originator"": ""String"",
    ""UserRole"": ""String"",
    ""UserId"": ""String"",
    ""OperationName"": ""String""
                        },
                        ""gtwyReqDtl"": {
                                  ""messageIP"": {
                                            ""EMPLOYEEDATA"": [{
                                                      ""EmpID"": "&ri!employee.EmpID&",                    
                                                      ""Name"": "&ri!employee.Name&",
                                                      ""Role"": "&ri!employee.Role&"                              
                                  
                                                      }          
                                            }]
                                  }
                        }
              }
    }"

    )

    I am able to get a response when the fields are given hardcoded values within the quotes say “123” or when the rule inputs are individual fields and not a CDT.
    When it is a CDT I get the below error –
    Expression evaluation error at function 'httppostwithresponse' parameter 6 [line 22]: Invalid index: Cannot index property 'EMPID' of type Text into type Text
Reply
  • 0
    Certified Senior Developer
    ... ""SessionId"": ""String"",
    ""Originator"": ""String"",
    ""UserRole"": ""String"",
    ""UserId"": ""String"",
    ""OperationName"": ""String""
                        },
                        ""gtwyReqDtl"": {
                                  ""messageIP"": {
                                            ""EMPLOYEEDATA"": [{
                                                      ""EmpID"": "&ri!employee.EmpID&",                    
                                                      ""Name"": "&ri!employee.Name&",
                                                      ""Role"": "&ri!employee.Role&"                              
                                  
                                                      }          
                                            }]
                                  }
                        }
              }
    }"

    )

    I am able to get a response when the fields are given hardcoded values within the quotes say “123” or when the rule inputs are individual fields and not a CDT.
    When it is a CDT I get the below error –
    Expression evaluation error at function 'httppostwithresponse' parameter 6 [line 22]: Invalid index: Cannot index property 'EMPID' of type Text into type Text
Children
No Data