Call the integration in the interface

Hello Appian People,

I have integration GET(Queries Data). Basically this integration search address.

And I call this integration in the interface. In my interface I have a texbox and search button,

whenever the search button is clicked if there is corresponding search result returned in the integration or

if the integration search result is onSuccess the result value will print.

So my problem is, how to check if  the result of the integration in the interface  fails/failure and gets the corresponding message

of the integration error?

  Discussion posts and replies are publicly visible

Parents
  • Hi, I have used the following API to implement the above (http://www.postalpincode.in/Api-Details). Hope this helps.

    a!localVariables(
      local!pinCode,
      local!integrationResult,
      local!isintegrationSuccess,
      {
        a!sectionLayout(
          label: "Find the post offices by Pin Code",
          contents: {
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!textField(
                      label: "",
                      labelPosition: "ABOVE",
                      value: local!pinCode,
                      saveInto: { local!pinCode },
                      refreshAfter: "UNFOCUS",
                      validations: {}
                    )
                  }
                ),
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "SEARCH",
                          style: "NORMAL",
                          saveInto: {
                            a!save(
                              local!integrationResult,
                              rule!JPS_INT_getDetailsByPostCode(pinCode: local!pinCode)
                            ),
                            a!save(
                              local!isintegrationSuccess,
                              and(
                                toboolean(
                                  index(local!integrationResult, "success", null)
                                ) = true(),
                                tointeger(
                                  index(
                                    local!integrationResult,
                                    "statusCode",
                                    null
                                  )
                                ) = 200
                              )
                            )
                          }
                        )
                      },
                      align: "START"
                    )
                  }
                ),
                a!columnLayout(contents: {})
              }
            )
          }
        ),
        a!richTextDisplayField(
          value: {
            a!richTextItem(
              text: local!integrationResult.result.message,
              color: "NEGATIVE",
              showWhen: local!isintegrationSuccess
            ),
            a!richTextBulletedList(
              items: local!integrationResult.result.body.PostOffice.Name,
              showWhen: not(local!isintegrationSuccess)
            )
          },
          showWhen: a!isNotNullOrEmpty(local!integrationResult)
        )
      }
    )

Reply
  • Hi, I have used the following API to implement the above (http://www.postalpincode.in/Api-Details). Hope this helps.

    a!localVariables(
      local!pinCode,
      local!integrationResult,
      local!isintegrationSuccess,
      {
        a!sectionLayout(
          label: "Find the post offices by Pin Code",
          contents: {
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!textField(
                      label: "",
                      labelPosition: "ABOVE",
                      value: local!pinCode,
                      saveInto: { local!pinCode },
                      refreshAfter: "UNFOCUS",
                      validations: {}
                    )
                  }
                ),
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "SEARCH",
                          style: "NORMAL",
                          saveInto: {
                            a!save(
                              local!integrationResult,
                              rule!JPS_INT_getDetailsByPostCode(pinCode: local!pinCode)
                            ),
                            a!save(
                              local!isintegrationSuccess,
                              and(
                                toboolean(
                                  index(local!integrationResult, "success", null)
                                ) = true(),
                                tointeger(
                                  index(
                                    local!integrationResult,
                                    "statusCode",
                                    null
                                  )
                                ) = 200
                              )
                            )
                          }
                        )
                      },
                      align: "START"
                    )
                  }
                ),
                a!columnLayout(contents: {})
              }
            )
          }
        ),
        a!richTextDisplayField(
          value: {
            a!richTextItem(
              text: local!integrationResult.result.message,
              color: "NEGATIVE",
              showWhen: local!isintegrationSuccess
            ),
            a!richTextBulletedList(
              items: local!integrationResult.result.body.PostOffice.Name,
              showWhen: not(local!isintegrationSuccess)
            )
          },
          showWhen: a!isNotNullOrEmpty(local!integrationResult)
        )
      }
    )

Children