
Hi -
On screen one of a 5-page form, the user will select a check box for the topics/pages need to be completed. The check boxes have been converted from a multi-select field and storing the values in a collection. I want to navigate to next page based on what that have chosen. I can get to the first selection using If(First(colType).Value = "Spill" , Navigate('Spill')) but don't know the best method for getting them to the remainder of their selections. I want to bypass the screens that are not needed. Also, I can't just go down the list because not everyone will enter them in the same order.
Any help would be appreciated!
No collection is needed for this, but having a navigation index variable will be needed.
If you have a multi-select combobox, then you already have the data you need.
Change your Items property of the combobox to be more like this:
Table({Value: "Spill", Screen: Spill},
{Value: "whatever", Screen: Whatever},
...etc...
)
So, for the variable, let's call it varFormIndex it will fit into the formulas as follows:
On your Next button, set the formula to the following:
Navigate(Index(yourCombobox.SelectedItems, Coalesce(varFormIndex, 1)).Screen);
Set(varFormIndex, Coalesce(varFormIndex, 1) + 1)
You will want to disable the Next button when you get to the end. You can use the following in the DisplayMode of the button:
If(Coalesce(varFormIndex, 1) > CountRows(yourCombobox.SelectedItems),
Disabled,
Edit
)
This should provide what you want.
I would recommend not having separate screens for all of these forms as you will be duplicating all the above over and over. All the forms can be on the same screen, and ideally, if the form is for the same record, you don't want to split the form without making sure you are doing so properly as it will break the form functionality and features.
I hope this is helpful for you.