Skip to main content
December 24, 2024
Question

Integration

  • December 24, 2024
  • 5 replies
  • 0 views

Hi All I have one scenario to be handled that -> If the user provides the amount as 0, load – (Minus) value in the payload.

I have written this logic but its not working that means values are not loading.

a!localVariables(
  local!crfxRateActivation_cdt: if(
    rule!APN_isBlank(ri!crfxRateActivation_cdt),
    rule!CR_APP_QE_getFxRateActivationData(
      requestId_int: ri!requestId_int,
      cif_int: ri!cif_int
    ),
    ri!crfxRateActivation_cdt
  ),
  rule!CR_APP_INT_setFxRatesRequestBody(
    preferredRate_txt: index(
      local!crfxRateActivation_cdt,
      1,
      "preferredRate_txt",
      {}
    ),
    fxCodes_txt: index(
      local!crfxRateActivation_cdt,
      "tariffCode_txt",
      {}
    ),
    fxRates_int: a!forEach(
      items: index(
        local!crfxRateActivation_cdt,
        "tariffAmountProposed_dec",
        {}
      ),
      expression: if(fv!item = 0, "-", fv!item)
    )
  )
)

The value which I am trying to send is at last logic,Please correct me If I am going wrong anywhere.

Thanks In advance,

    5 replies

    somasundaram.d
    December 24, 2024

    In the rule "CR_APP_INT_setFxRatesRequestBody" it seems "fxRates_int" expects a integer value, but you are passing a text "-"

    December 24, 2024

    No i have defined it as text but naming convention kept as int, But the thing this i could see the result in response body .But while calling integration not working

    stefanhelzle0001
    December 24, 2024

    I do not really understand what is going on here. Can you elaborate?