Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

set the value of a process variable in an expression

Certified Associate Developer

Hello community,

is it possible to set/change the value of a process variable in a scripttask/expression for example when a condition is true other than node output is stored as.

I know how to set a value of a processvariable in the node output, but can it be done in like setting the value of a localvariable?
example:
if(pv!fruit="Apple",
pv!color:"green",
""
)

Kind Regars,

Erik

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    Hello Mike,

    What I am trying to accomplish is to set the value of multiple pv's based on the value of 1 other pv. Then the values of the multiple pv's will be used/configured in the doc from template service. 
    No I configured one expression for each pv separately in the nodeouput of a scriptask to save the value. So wanted to know if it is possible to update all the pv's in one expression.

    Kind Regards,

    Erik

Children
  • 0
    Certified Lead Developer
    in reply to erikb0001

    Ah i see.  No, the way you've done it is the correct way.  I've wished at times for the ability to update multiple PVs based on one expression (such as an expression that runs an expensive calculation, and i want to just run it once and save various aspects of the result to different PVs).  The only real alternative here is to run the expensive operation in an input variable (which sucks since input variable expressions STILL collapse the expression code they contain down to one line, upon saving...), then refer to that ACP in the different output expressions.  But even this still does require one output entry added for each PV you want to write into.