I am creating a graph that has two lists. Depending on the users input (in this case 1, 2, or 3) I want to either send through the data from list 1, list 2, or a combination of the two. In the example below, I am using the Number on the top left to represent the users input. There are two lists, one with 6 items and one with 13. Based on my “logic” I expect the following results: user enters 1 and gets list 1 with 6 items or user enters 2 and gets list 2 with 13 items or user enters 3 and gets a combination with 19 items.
The problem is that whatever number the user enters, I keep getting list 1 regardless. The first if statement is updating properly but the second if statement seems to not care.
Keep in mind ScopeIf only works if the inputs are self contained as it only runs one input at a time. For this reason it’s good to get familiar with the index method that @Kulkul showed.
Since the user is feeding a number, you could build a list of all the lists (including a flattened version of the combo list), subtract one from the selected number, get the item from the combined list at the resulting index. I’m a single line of design script it looks something like this:
@Daan@jacob.small I simplified the graph to illustrate the problem I am having with a bigger graph. In the actual graph, users are picking an option in a Data Shapes UI window. The results are either 1, 2, or 3 which are then fed into the logic statement that I posted here.
@Daan I do not understand what you mean by this. Both of my IF statements are currently fed with booleans into the test input.
@Kulkul@jacob.small I will try the Index method you both have illustrated. I already tried the ScopeIf and it crashed my graph (or just ran so slow that I gave up waiting for it). I will let you know how it goes.
@Daan No. There are two lists (two different grouping of views from a model in this case…one contains sections, elevations, and details…the other contains plans). The user is picking whether they want the graph to deal with sections/elevations/and details only…plans only…or everything. Their selection outputs a 1, 2, or 3 which represents their selection. That is fed into the If statements to produce the resulting list that they want.
@Daan That did work. Here is that method worked into a larger portion (still somewhat simplified) of my graph. I forgot to mention that the two inputs the user gets produce a 1 and a 2 and if they select both the Math.Sum node produces a 3.