Skip to main content
August 10, 2021
Question

Null argument not allowed

  • August 10, 2021
  • 1 reply
  • 0 views

Hi team,

I am  going through this appian tutorial  Process Modeling Tutorial - Appian 21.2  but error in expenseReportSummary Interface like this "Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'user' [line 5]: Null argument not allowed".

i have interface

{
a!textField(
label: "Requester",
labelPosition: "ADJACENT",
value: user(ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}AT Expense Report.fields.{pp}pp.{initiator}initiator'], "firstName") & " " & user(ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}AT Expense Report.fields.{pp}pp.{initiator}initiator'],"lastName")
),
a!textField(
label: "Amount",
labelPosition: "ADJACENT",
value: ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}AT Expense Report.fields.{expenseAmount}expenseAmount'],
readOnly: true
),
a!textField(
label: "Date",
labelPosition: "ADJACENT",
value: ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}AT Expense Report.fields.{expenseDate}expenseDate'],
readOnly: true
)
}

error in user()

Thanks,

kiran

    1 reply

    selvakumark
    Participating Frequently
    August 10, 2021

    Hi [mention:b48ead69d2cb4b62840fcc6bb8441dc8:e9ed411860ed4f2ba0265705b8793d05],

    The user() function does not allow null arguments. Hence you're getting this error. Try placing a null check for the arguments before the user() function. Also, make sure that you pass the data to the input of the interface for testing.

    Sample code:

    a!textField(
      label: "Requester",
      labelPosition: "ADJACENT",
      value: if(
        isnull(
          ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}.fields.{pp}.{initiator}']
        ),
        "Username is unavailable", /*Customized message*/
        user(
          ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}.fields.{pp}.{initiator}'],
          "firstName"
        ) & " " & user(
          ri!expenseReport['recordType!{618f143c-4310-4256-a9c3-b96fe7161fcf}.fields.{pp}.{initiator}'],
          "lastName"
        )
      )
    )