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
2 replies
Subscribers
7 subscribers
Views
1507 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have CDT array, CDT has a property :Name. I receive CDT array from web-service
komalk
over 8 years ago
I have CDT array, CDT has a property :Name. I receive CDT array from web-service. I need to check if CDT.Name is null then set it to some default value. I tried this is expression rule and process models too. Bt I am not able to set the value in CDT array. Also CDT array received can be of any length, 0 or 50. So need to find logic that will loop through CDT and check property Name if null and set it to default value. Thanks
OriginalPostID-165432
OriginalPostID-165432
Discussion posts and replies are publicly visible
Parents
0
hrishikeshd
over 8 years ago
The apply function can solve your purpose. You can write an expression that takes a single value, default text and loop this function over your cdt property name array.
Eg: apply(rule!setDefaultIfNull, pv!cdtArray.name, "defaultValue") -- store the result of this into -> cdtArray.name
rule!setDefaultIfNull -- if(rule!APN_isEmpty(ri!name), ri!defaultValue, ri!name)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
hrishikeshd
over 8 years ago
The apply function can solve your purpose. You can write an expression that takes a single value, default text and loop this function over your cdt property name array.
Eg: apply(rule!setDefaultIfNull, pv!cdtArray.name, "defaultValue") -- store the result of this into -> cdtArray.name
rule!setDefaultIfNull -- if(rule!APN_isEmpty(ri!name), ri!defaultValue, ri!name)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data