cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pm13
Frequent Visitor

unable to use PowerApps filter function on a SharePoint lookup column

What is the best way to filter a SHarePoint Lookup field in a PowerApps canvas app?

 

I have an "Asset" list with 2 fields.
"AssetName" column (Text Field)
"AssetType" column (Lookup "TypeOf" column from "Type" list)

 

"Type" list has 1 field
"TypeOf" column (Text Field)


Now I have a List called "Service" with 2 fields
"AType" field (Lookup "AssetType" column in "Asset" List)
"AName" field (Lookup "AssetName" column in "Asset" list - But filter based on selected AType column)


Now this is how I did it in PowerApps

 

"ATypeDropdown" dropdown field
item property is Choices(Asset.'AssetType')

 

"ANameDropdown" dropdown field
item property is Filter(asset.'AssetType'=ATypeDropdown.selected.value).'AssetName'
But this doesnt work for me, I get an invalid argument type error.

 

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @pm13 ,

 

I think you need to achieve this using a standalone dropdown control(outside the edit form) and then use Patch to update the item. For the standalone "ANameDropdown" dropdown field, set the Item property to:

Filter(Asset,AssetType.Value=ATypeDropdown.Selected.Value).AssetName

Then to Patch this AName field, use a formula like below:

Patch(Service,Defaults(Service),
{AType:ATypeDropdown.Selected,
AName:
{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id:Filter(Asset,AssetName=ANameDropdown.Selected.Value).ID, Value:ANameDropdown.Selected.Value}
})

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-monli-msft
Community Support
Community Support

Hi @pm13 ,

 

I think you need to achieve this using a standalone dropdown control(outside the edit form) and then use Patch to update the item. For the standalone "ANameDropdown" dropdown field, set the Item property to:

Filter(Asset,AssetType.Value=ATypeDropdown.Selected.Value).AssetName

Then to Patch this AName field, use a formula like below:

Patch(Service,Defaults(Service),
{AType:ATypeDropdown.Selected,
AName:
{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id:Filter(Asset,AssetName=ANameDropdown.Selected.Value).ID, Value:ANameDropdown.Selected.Value}
})

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (47,225)