cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahhollan
Helper V
Helper V

Switch function and 'expected table value' error

I have the following formula in my app - 

Switch(ddLocation_1.Selected.Value,"COC",LookUp([@'SBU/BU'], Title=DataCardValue67_1.Selected.Result, 'COC Design Tech'),"KOC",LookUp([@'SBU/BU'],Title=DataCardValue67_1.Selected.Result, 'KOC Design Tech'),"Muscle Shoals",LookUp([@'SBU/BU'],Title=DataCardValue67_1.Selected.Result, 'Muscle Shoals Design Tech'),"TPS Sites",LookUp([@'SBU/BU'],Title=DataCardValue67_1.Selected.Result,'Outlying Areas'),"-",LookUp([@'SBU/BU'],Title=DataCardValue67_1.Selected.Result,'Outlying Areas'),"Other",LookUp([@'SBU/BU'],Title=DataCardValue67_1.Selected.Result,'Outlying Areas'))

 

I keep getting the 'expected table value' error. Can someone assist? I'm sure it's probably simple.

3 REPLIES 3
HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

What controls and properties are at play here. To me this is going to be returning a single record by using the LookUp, whereas it is wanting a table of values, not just a single record. So you would either need to construct a table using the result of the LookUp or do a Filter if it is applicable and more than one entry is valid.

However a LookUp should be valid, just depends on the control and property that is taking that LookUp result.

I would also be tempted to take off the ,column name at the end of each LookUp

The controls are a Location dropdown and a people picker for Space Management Lead. Based on the Location selected, the value of the people picker should be prepopulated.  

 

Can you explain more about using the filter instead of lookup? 

Hi,

 

I went to recreate but could you explain  a bit more where this is coming in: DataCardValue67_1.Selected.Result.

Need a bit more info on the data source.

So I created two drop downs, one with the following items:

["COC","KOC","Muscle Shoals","TPS Sites","-","Other"]

I then went to configure the second drop down based on a switch.

 

So I could see that we are switching on one of the values in the first drop down of:

 

["COC","KOC","Muscle Shoals","TPS Sites","-","Other"]

When we get to setting the default value of the second drop down I read it as:

LookUp a datasource called SBU/BU (Is this a SharePoint list), where the Title in this data source equals ?, Bring back the contents of the COC Design Tech Column (is this a person).

 

 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,390)