Onload repeater , default case (Solved)

Hi Gang

I have been looking everywhere but i cannot find any information on what im looking for.

i have a repeater, that has several criterias depending on …different things, But its only some of the items in the repeater that needs that check, not the entire row. Right now i have to put those also in the different cases if and else parts, otherwise they dont get loaded

Example ( huuuuge RP file so im not sending that.)

OnItemLoad
Case 2 (if “[[item.Active]]” equals “1”)
set text on Title-label equal to “[[item.RPtitle]]”
set text on remaining-label equal to “item.RPremaining”
show shape-Yellow
Case 3 (else if "[[item.RPremaining]] equals “queue”)
set text on Title-label equal to “[[item.RPtitle]]”
set text on remaining-label equal to “Queue”
Case 4 (Else if True)
set text on Title-label equal to “[[item.RPtitle]]”
set text on remaining-label equal to “Return”

What im looking for is a way to have Title-label just declared once! since it doesnt change.
for example

OnItemload
  **case 1** (something something)
  set text on Title-label equal to "[[item.RPtitle]]"
  set text on remaining-label equal to "item.RPremaining"

THEN!

 Case 2 (if "[[item.Active]]" equals "1")
show shape-Yellow
 Case 3 (else if "[[item.Remaining]] equals "queue")
set text on remaining-label equal to "Queue"

Case 4 (Else if True)
set text on remaining-label equal to “Return”

in case 2-4, all the items from case 1 is included

Is this possible?
or do i have to give the repeater widgets the default values and not pull those from the repeater cells onload?..and then change the ones i want?

/Z

There is a toggle in the context menu of a case to toggle if / else if.
If set to “if” the case gets triggered all the time.
If set to “else if” only if a previous case returned false (didn’t apply)

Maybe I am missing something?

1 Like

Thanks for the answer Zuvala!

the problem i see is that if the first case gets triggered with the (if True)
the others dont? ill test it …

/Z

It depends. An “ELSE” case will only be checked if the one before did not evaluate to true. Cases that are “IF” (and not “ELSE IF”) the case will always be checked.

You can use “ELSE” to save yourself some conditions for related cases. For example:

IF Variable is true
    Do one thing
ELSE IF true
    Do another thing

The second one will only happen if the first condition was not true. However if you have multiple cases that are effectively independent of one another, then you probably don’t want “ELSE”

IF Variable1 is 'red'
   Do red thing
IF Variable2 is greater than 100
   Do numbers thing
IF Variable3 is less than 10
   Do a different thing
1 Like

It worked!
Made a duplicate page and tested,

Thanks!!

nice to hear! cheers