We're setting up two variable OnStart:
Set(MainConnectionNumber,
RandBetween(0, 2)
);
Set(MainConnection,
Switch(
MainConnectionNumber,
0, "SpList1",
1, "SpList2",
2, "SpList3"
)
);
The question: is it possible to use that MainConnection variable in say a Gallery.Items formula i.e.
Sort(
MainConnection, -- use the variable here instead of directly stating the 'SpList'
Column = User().Email,
CustomerName
)
I cannot seem to get this to work.
The alternative is to skip creation of MainConnection and instead use switch statements wherever we connect to SharepointLists, however it means we end up duplicating logic for each potential connection which gets unwieldy i.e.
Gallery.Items
Sort(
Switch(ConnectionNumber,
0, Filter('Sp List', StartsWith(CustomerName, txt_FilterText.Text)),
1, Filter('Sp List_1', StartsWith(CustomerName, txt_FilterText.Text)),
2, Filter('Sp List_2', StartsWith(CustomerName, txt_FilterText.Text))
),
CustomerName
)