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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,763)