for explaining sake im using this examples
Let's say
local!role : index( local!lookupDetails, wherecontains( cons!IHL_TXT_R_ALL_CATEGORIES[1], index( local!lookupDetails,"role" null ) ) )
i need to use one values from the record in my UI many places
for that can i hold it in one local and pass wherever needed.
or can i use it directly wherever i needed
if so i need to call index,whereconains in many places right dont it consume memory
and it will make the code repetitive lines get increasewhat is the best practice.
Discussion posts and replies are publicly visible
If I need a computed value multiple times, I use local variables to reduce the evaluation time.
if no need of compute ?
Dinesh Arumugam said:if so i need to call index,whereconains in many places right dont it consume memory
This what compute means in your case. We generally go with first approach it's best practice not only in Appian but in other coding languages too
Well, a value that is not computed is a static value. If this is needed in multiple places, creating a constant for it might be a good idea.
it is coming form RI as a record type
Storing a rule input value into a local for no specific purpose makes no sense and is not required.
im storing it to pass in multiple places in my UI
Sure, but you can also just pass the rule input.