
Announcements
Hi All
I need to add item to one of 20 SP Lists(depending on one value) so I am trying to do
Collect(
Switch(OneValue,
1, If(Value2=1, SPList1,SPList2) ... and so on for 20 times
),
{Col1:data1, Col2:data2}
)
But getting "The specified Data Source cannot be used with this function"
If I change Switch to SPList1 it works fine so it looks like Collect not happy with using Switch to select data source
Yes, I am just running into a similar issue where I would like to be able to easily toggle between production and development environments in a similar fashion, but that does not yet appear to be an option. I believe you will need to actually perform the collect inside the switch to accomplish this.
Switch(OneValue,
1, Collect(SPList1, {Col1:data1, Col2:data2}),
2, Collect(SPList2, {Col1:data1, Col2:data2}),
repeat for all twenty lists
)
I will have to do the same with my Patch statements, using a Switch to determine whether to patch to Resources or ResourcesDEV.