Skip to main content
dinesha5713
November 14, 2024
Question

which is Efficient way

  • November 14, 2024
  • 9 replies
  • 0 views

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 increase

what is the best practice.
 

9 replies

stefanhelzle0001
November 14, 2024

If I need a computed value multiple times, I use local variables to reduce the evaluation time.

dinesha5713
November 14, 2024

if no need of compute ? 

venkatrea696188
November 14, 2024
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