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
13209 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
brindas1
over 7 years ago
@geetp, try using curly brackets. E.g. if(condition =true, {field1, field2 , field3}, field4)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@geetp can you share the SAIL code, if the suggestion mention by @brindas did not work for you, but as per my understanding using braces should work as suggested by @brindas too, i think the issue was, instead of using {} you were trying to use ()
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
Many thanks for your response. Being a newbie I really appreciate your help. I shall try and give it a go.. I have another q- hope you can help on that too. I have created a quick app and I have a field called overdue- in the value- I have defined if statement ( if today> ri!input , " not overdue","overdue"). Although it works well in interface to give correct result, doesn't work in tempo. I am saving the value in ri!overdue. Can you pls shed some light on where am I gng wrong pls
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 7 years ago
Possible things:
1. Assume that if(fn!today()>ri!input,"not overdue","overdue") it is an expression rule that takes an rule input i.e "input", if so please check the in SAIL are u passing ri!overdue while calling the above rule.
2. if you are checking inside SAIL code only then u need to check with ri!overdue instead of ri!input
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@geetp is there any possibility of having null values for ri!input at initial or in any case, if yes, then first try to handle the null before doing comparison as attached below
isEmpty Expression Rule
=======================================
if(
or(
isnull(
ri!input
),
len(ri!input)<1,
length(ri!input)<1
),
true(),
false()
)
=======================================
here ri!input is of Any Type
Interface
=================================
if(
rule!isEmpty(ri!input),
{},
today > ri!input
)
==============================
also try printing this above statement along with any label of the Form and then Test, hope this work
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
Thanks.. This is what I have got.
a!textField(
label: "Overdue?",
labelPosition: if(ri!readOnly, "ADJACENT", "ABOVE"),
instructions: if(ri!readOnly, "", ""),
helpTooltip: if(ri!readOnly, "", ""),
placeholder: if(ri!readOnly, "", ""),
value: if(
today () >workday(ri!record.requestReceivedDate,5),
"Overdue",
"Not Overdue"),
saveInto:ri!record.overdue,
required: false,
readOnly: true,
validations: if(
today () >workday(ri!record.requestReceivedDate,5),
"Overdue",
"Not Overdue"
)
)
interface inputs- CDT record.requestreceiveddate & record.overdue. Haven't defined any local variable for overdue
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@geetp as you are using workday function, so make sure that the input for this function should never have the null value either at parameter1 or at parameter2
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
Apart from this everything seems to be good, i think here null is causing the issue. For debugging purpose, try replacing ri!record.requestReceivedDate with today() function at both the place
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
geetp1
over 7 years ago
The result is good in interface but when I try checking the value in variable overdue- it doesn't seem to be saving.. Is my saveinto syntax correct?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@geetp if ri!record.overdue is of type Text then yes its Correct
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>