I have multiple, identical SharePoint lists and I'd like to load a particular list on all screens based on a global variable called varProject. I'd like to be able to set all forms and galleries to have a data source of colClaimsList, and then switch out the records they display based on a global variable selection set with a button click on the home page of the app.
With the global variable is set, I hoped to create a collection (using ClearCollect) based on the varProject value.
The variable is getting set correctly, but I can't seem to get the collection created. I'm doing stuff like this:
If(
varProject = "Project1",
ClearCollect(
colClaimsList,
'Claims-Project1'
);
If(
varProject = "Project2",
ClearCollect(
colClaimsList,
'Claims-Project2'
)
)
);
Navigate(SELECT)
Is this not possible? Powerapps seems perfectly happy with the syntax but the collection is not being created/populated. It's always empty. Thanks in advance for your help.