Within my app I frequently use a Switch function to point features to different data sources depending on which the user has selected. It is reflected in the Global Variable BusinessUnit. This works well for tables, forms, etc.
Switch(
BusinessUnit,
"TableA",
'[dbo].[TableA]',
"TableB",
'[dbo].[TableB]',
)
The following code works as expected:
UpdateIf(
'[dbo].[TableA]',
UID in DataTable.UID,
{Date: DataCard1.Update}
)
However, implementing the data source switch, it does nothing:
UpdateIf(
Switch(
BusinessUnit,
"TableA",
'[dbo].[TableA]',
"TableB",
'[dbo].[TableB]',
),
UID in DataTable.UID,
{Date: DataCard1.Update}
)
Is this a limitation, expected behavior or bug with UpdateIf? The same method works in all other locations I have used it.
I need to find a workaround that is the least obtrusive, which may be to move the Switch function outside and repeat the UpdateIf multiple times.