Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
5 subscribers
Views
2441 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
How do I optionally save a custom data output to an array? A script task custom
greggl
over 9 years ago
How do I optionally save a custom data output to an array? A script task custom Data Output requires a target output, so if I try and use an if conditional like this: if(pv!newStaff.hireDate > today(),pv!newStaff.firstName,{}), I end up with a array index of blanks, when I really want no array index added. I want to be able to only add to array index if condition is met but as target output is required, it's saving a blank rather than do nothing as desired.
How can this be done?
Thanks
OriginalPostID-147849
OriginalPostID-147849
Discussion posts and replies are publicly visible
Parents
0
Chris
over 9 years ago
Instead of using 'appended to' in the output condition, use append() in the expression and choose 'save as' for the condition. ex:
if(pv!newStaff.hireDate > today(),append(pv!YourArrayHere,pv!newStaff.firstName),pv!YourArrayHere) -> Save As -> pv!YourArrayHere.
Which will essentially either append a value to pv!YourArrayHere, or save the array back to itself (i.e. doing nothing).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Chris
over 9 years ago
Instead of using 'appended to' in the output condition, use append() in the expression and choose 'save as' for the condition. ex:
if(pv!newStaff.hireDate > today(),append(pv!YourArrayHere,pv!newStaff.firstName),pv!YourArrayHere) -> Save As -> pv!YourArrayHere.
Which will essentially either append a value to pv!YourArrayHere, or save the array back to itself (i.e. doing nothing).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data