Hello everyone,
I am building an app and have many screens (approx. 50) half of which will use the same code to navigate to the next screen. Problem is the different options for this navigation will change and increase over time so I need to have the code in one place so I can update all screens with one change.... so reuse the code.
I have looked at using the toggle button but other posts state that this isn't the best solution and often causes errors.
Therefore, I would like to use a component, is this possible by just calling a variable which triggers the component and executes the code?
Pasted in below is the code I want to use:
Set(NextCount, Switch(ProdDirOut,
"Prod1",
First(Sort(Filter(Prod1, OpCode01 > CurrCount), OpCode01)).OpCode01,
"Prod2",
First(Sort(Filter(Prod2, OpCode01 > CurrCount), OpCode01)).OpCode01,
"Trial",
First(Sort(Filter(Trial, OpCode01 > CurrCount), OpCode01)).OpCode01
)
);
Set(NextStep, Switch(ProdDirOut,
"Prod1",
LookUp(Prod1, OpCode01 = Value(NextCount), Step),
"Prod2",
LookUp(Prod2, OpCode01 = Value(NextCount), Step),
"Trial",
LookUp(Trial, OpCode01 = Value(NextCount), Step)
));
I watched a couple of online lessons on components, but they don't cover code reuse via variables.
Thanks for your help.
Rob