Skip to main content
March 27, 2025
Solved

Record Type from a WebService. Error syncing. Type could not be inferred due to inconsistent types for field(s)

  • March 27, 2025
  • 6 replies
  • 0 views

As you can see, I'm creating a new Record Type from a Webservice. I get de data properly.

But when I try to sync the data in the Record Type I get the following error: Type could not be inferred due to inconsistent types for field(s): discountPercentage

I think the format is ok. Do you why I getting the error? As you see bellow in the Expression Rule commented code, I map the fields formating the decimal fields but I don't to do so because I would map all the fields.

Any idea to solve it? Thanks!

    Best answer by varuntejg243705

    Hi [mention:8cdd6119fd07485ea8670348a7dd2045:e9ed411860ed4f2ba0265705b8793d05] ,

    I think somewhere the discountPercentage  is returning a null value or an unexpected type(Type mismatch).

    If some records have discountPercentage as null or "" (empty string), Appian may infer conflicting types (Decimal vs. Text).

    I suggest you to write the below code to handle the issue..

    toDecimal(
      if(
        or(
          a!isNullOrEmpty(fv!item.discountPercentage),
          fv!item.discountPercentage = ""
        ),
        0,
        fv!item.discountPercentage
      )
    )


    Hope this will solve the issue, Or you can reply back with!!!

    6 replies

    varuntejg243705
    March 27, 2025

    Hi [mention:8cdd6119fd07485ea8670348a7dd2045:e9ed411860ed4f2ba0265705b8793d05] ,

    I think somewhere the discountPercentage  is returning a null value or an unexpected type(Type mismatch).

    If some records have discountPercentage as null or "" (empty string), Appian may infer conflicting types (Decimal vs. Text).

    I suggest you to write the below code to handle the issue..

    toDecimal(
      if(
        or(
          a!isNullOrEmpty(fv!item.discountPercentage),
          fv!item.discountPercentage = ""
        ),
        0,
        fv!item.discountPercentage
      )
    )


    Hope this will solve the issue, Or you can reply back with!!!

    March 27, 2025

    It works. Thanks!!