Skip to main content
nicholaso0002
March 16, 2022
Question

How do you pass process variable parameter into an expression

  • March 16, 2022
  • 14 replies
  • 0 views

I am trying to pass the value of a process variable into my expression, and the expression is also used in the process model.

Please, see attached image:

The rule - drxxxxStoredProcedureDirDepAggregatedPaymentForDate looks like this:

executestoredprocedure(
  datasourceName: "jdbc/ABC",
  procedureName: "dbo.procCtePaent",
  inputs: {
    {
      name: "date_param",
      value: ""
    }
  }
).result[1]

    14 replies

    gopalk2865
    Participating Frequently
    March 17, 2022

    Hi , create a rule input in your expression rule. Once you use this expression in a process model then pass the process variable into it. For example if you have a rule called "getEmployeeDetails" and you have rule input "employeeId" in it. Then , when you call this rule in process model ,it should look like below,

    rule!getEmployeeDetails (employeeId:pv!employeeId).

    So in your case , create a rule input of "paymentDate" and then, once you call it in process model pass the process variable.

    nicholaso0002
    March 17, 2022

    this expression is not returning value. But the stored proc has values.

    mikes0011
    Brainy
    March 17, 2022

    Why are you calling your Stored Procedure rule twice just to check whether it returns an empty value?

    The Expression Guru
    harshitb6843
    March 17, 2022

    Hi there,

    All the domains are not accessible everywhere in Appian. For ex. you can only use pv! domain in a process model. Therefore, to check which all domains can be used, check for the domains icon on the toolbar of the corresponding expression editor. 
    Like the other commenter mentioned, you will have to pass that value inside the ER using an RI.