It depends on what you mean by “interactions”. Your description does not really deal with multiple interactions. Rather, it looks like you have one interaction event (Item Loaded) and many conditional cases …and I’m assuming all have the same basic action of Set Panel State.
So, am I correct in understanding that you have 49 conditional cases here?
Likewise, what is the “single component”? The dynamic panel? The repeater? Something else?
I’m not sure I understand all of what you need to achieve here, the 7 states with various “bar parts” (1 per day of week?), nor what the “49 interactions” entail (…7 weeks x 7 days?) etc. But, sure seems like you could pare this down a lot if you can represent as much as you can with numbers instead of text, and use algorithms instead of multiple Else If conditions.
Also, you should be able to greatly reduce–and even completely eliminate–your conditional cases by directly representing things in your repeater datasheet to match the names of your dynamic panel states. For example, if the “sem1” has 8 possible values (including a blank value or empty cell), just use the state name of the dynamic panel directly in your datasheet–and probably easiest at this time if you name the states to match what you currently use in the datasheet cells (e.g, maybe rename “State 1” to “ini1 cverde”) That alone could get rid of all the conditional cases you show.
I also see you have 8 cases per week with the last case of each week being “Else if true” --That is not good at all and is practically guaranteed to fail. You never ever want more than one “If true” case, because only the first one will get triggered. Not clear what actions you have for all these cases, but I might guess you are hiding the dynamic panel if the data cell is blank? If so, it would be better to have the default (top-most) state be blank–then you don’t have to deal with blank cells at all.
Here are high-level details of the approach I’m recommending (if I understand your labels):
- Dynamic Panel (2) should have these states:
- Blank (contains nothing; this is the default state)
- ini1 cverde
- ini2 cverde
- ini3 cverde
- ini4 cverde
- ini5 cverde
- ini6 cverde
- full cverde
- (your repeater datasheet cells must have these same exact labels)
- The Item Loaded event just needs one action in its “If true” case to handle all possibilities:
Set Panel State of BarPanel to [[Item.sem1]]
(where “BarPanel” is the name of your dp widget)
- Then, add similar Set Panel State actions for each week, all in the same “If true” case.
- Note that if a row is blank (or if it contains any other string that does not match a state name) the Set Panel State will ignore it–so the dp would not change states–it would just remain in the default state of “Blank” --which is what you want.