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
8 replies
Subscribers
8 subscribers
Views
4913 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
#SAIL I'm looking for a way to hide and show certain fields in a
brandonc
over 9 years ago
#SAIL
I'm looking for a way to hide and show certain fields in a section but keep getting an error when the if statements return a null because I don't want any of the fields to show up and can not have a blank item present.
"Interface Definition: Expression evaluation error at function a!sectionLayout [line 29]: The contents field on a column layout cannot be a list containing a null. Invalid value at index 1."
What is the best way to handle this?
I have tried doing the complete column into an expression and grab it using a load() but the expression is only returning the first item not any of the others
OriginalPostID-169245
OriginalPostID-169245
Discussion posts and replies are publicly visible
0
Tom Ryan
Appian Employee
over 9 years ago
If I understand correctly, you should be able to replace any nulls with an empty list, eg
if( <some condition>, <some SAIL component>, { } )
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinitl522
A Score Level 2
over 9 years ago
Brandon, As i understand, If you are using a datasubset and verifying null, you should first verify if( isnull(local!datasubset.data), null or {}, if(isnull(local!datasubset.data.name), {}, sailcomponent))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
brandonc
over 9 years ago
Replacing the nulls with an empty list still gives me the same error
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinitl522
A Score Level 2
over 9 years ago
Can u share ur code syntax once
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
brandonc
over 9 years ago
a!sectionLayout(
firstColumnContents:{
if(local!urgent=0,{},{a!textField(
label:"Test",
value:"",
readOnly:true)}),
... more sailcomponents
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@brandonc As said by others, the empty lists or null might not work in all the cases as far as my SAIL experience is considered(Atleast it didn't work for us..!). There are two ways to tackle this and this is how we did:
Approach - 1:
In place of null or empty list, we do provide a component which is not surfaced to end user. You may opt for this approach if you feel that this hidden component doesn't disturb the layout or alignment in the interface.
if(
\t
,
\t{show desired component},
\t{a!textField(label:"",value:"",readOnly:true)}
)
Approach - 2:
You may opt for this approach if you feel that the Approach - 1 disturbs the layout or alignment in the interface.
if(
\t
,
\ta!sectionLayout(
\ tlabel:"Some Section",
\ tfirstColumnContents:{
\ t
\ t}
\t),
\ta!sectionLayout(
\ tlabel:"Some Section",
\ tfirstColumnContents:{
\ t
\ t}
\t)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rahul Gundu
over 9 years ago
Hi brandonc,
Look into the recipe.
The same can be applied in your case.
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
brandonc
over 9 years ago
I went with Approach - 2 Thank you for your help sikhivahans
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel