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
18 replies
Subscribers
8 subscribers
Views
13357 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
If true value with multiple fields
geetp1
over 7 years ago
Hi, I am trying to get 3 fields if the condition is true but it doesn't seem to be working with brackets.. Can somebody pls shed some light. E.g. if ( condition=true, (field1 field2 , field3), "false field)
OriginalPostID-272292
Discussion posts and replies are publicly visible
0
aloks0189
Certified Lead Developer
over 7 years ago
@geetp here i would like to suggest 3 things for you in order to resolve your issue,
1) For Value as well as saveInto, first of all perform null checking as i suggested using isEmpty Function, if(null,{},your code goes here) before doing any manipulation, which you are currently doing as per above attached code
2) Do not display validation message, if the conditions are met positive, because it will restrict the value to be save in Rule Input, instead try returning {}
3) declare a local variable in load as
load(
local!val: if(
rule!AKIAL_isEmpty(ri!record.requestReceivedDate),
{},
if(
today () >workday(ri!record.requestReceivedDate,5),
"Overdue",
"Not Overdue")
)
),
a!formLayout(
a!textField(..................)
)
)
and on saveInto of any button Click, perform following to save local! value into Rule Input
a!save(ri!record.requestReceivedDate, local!val)
That will work for you
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
It was a Typo, instead of AKIAL_isEmpty() try using isEmpty() as suggested in above SAIL Code
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
thanks very much for your valuable advise I really appreciate it. I shall give it a try and let you know how I go..
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
Hello@aloks176- getting error- Expression evaluation error in rule 'd2_overdue' (called by rules 'd2_dliteworkreleasedetails' > 'd2_createupdatedliteworkrelease') at function 'workday' [line 5]: A null parameter has been passed as parameter 1..
It works fine in interface but not in tempo.. what I did was I created a rule D2_overdue:
if(
false(ri!requestReceivedDate),
{},
if(
today () >workday(ri!requestReceivedDate,5),
"Overdue",
"Not Overdue")
)
and in interface:
load(
local!overdue,
a!textField(
label: "Overdue?",
labelPosition: if(ri!readOnly, "ADJACENT", "ABOVE"),
instructions: if(ri!readOnly, "", ""),
helpTooltip: if(ri!readOnly, "", ""),
placeholder: if(ri!readOnly, "", ""),
value: rule!D2_Overdue(ri!record.requestReceivedDate),
saveInto:{
ri!record.overdue,
local!overdue,
a!save(ri!record.overdue,local!overdue,null)
},
required: false,
readOnly: true
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
Please disregard, I am successful :) thanks once again..
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@geetp happy to see that it worked :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
davids735
over 7 years ago
In reference to your first question, another option would be to set a local variable to true or false on the basis of the if(). Then just set the hidden: value of each of the fields to that local variable, or in one case set it to NOT that variable
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
many thanks @davids735, the original suggestion did work but I appreciate your response on this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<