cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SandraAkujobi
Post Partisan
Post Partisan

How to filter column

On SharePoint list I have a lookup column for in the timesheet list that collects contract no from another list called Contracts, the issue is there's over 5000 items. On Powerapps I am trying to see if I can filter the field to only show active contract no's but I'm unsure on how to go about it. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @SandraAkujobi ,

Do you mean that:
1)you have a lookup field which looks up to contract no in Contracts list?

2)you want to filter this lookup field to only display active contract?

Could you tell me the data type of the field that records status of contract in Contracts list?

I assume that this field is named status and its data type is Choice.

If so, actually your key point is to avoid delegation.

Since Choices() function is not delegate, so I do not suggest you use this common solution to set lookup field.

You could set like this:

1)if you use form to update this lookup field

set the combo box's Items:

Filter(Contracts,status.Value="active")

set this field datacard's Update:

{Value:DataCardValue5.Selected.'contract no',Id:DataCardValue5.Selected.ID}
//DataCardValue5 is this combo box name

 2)if you use patch to update this lookup field

set the combo box's Items:

 

Filter(Contracts,status.Value="active")

 

Patch function should be like this:

 

Patch(...,....,
      {lookupfieldname:
                       {Value:DataCardValue5.Selected.'contract no',Id:DataCardValue5.Selected.ID},
        ...
       }
      )
//DataCardValue5 is this combo box name

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

11 REPLIES 11
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @SandraAkujobi 

YOu can use like below.

Filter(DataUserCollection,IsLiked=true)



VijayTailor_0-1601049785306.png

 

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Please Vote for my idea if you feel, that will help you in the future or good to have in power app.
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Ability-s-to-Select-Icon-from-UIFabric/idi-p/69...

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Preview-Mode-for-All-the-Device-Like-Phone-Tabl...

v-yutliu-msft
Community Support
Community Support

Hi @SandraAkujobi ,

Do you mean that:
1)you have a lookup field which looks up to contract no in Contracts list?

2)you want to filter this lookup field to only display active contract?

Could you tell me the data type of the field that records status of contract in Contracts list?

I assume that this field is named status and its data type is Choice.

If so, actually your key point is to avoid delegation.

Since Choices() function is not delegate, so I do not suggest you use this common solution to set lookup field.

You could set like this:

1)if you use form to update this lookup field

set the combo box's Items:

Filter(Contracts,status.Value="active")

set this field datacard's Update:

{Value:DataCardValue5.Selected.'contract no',Id:DataCardValue5.Selected.ID}
//DataCardValue5 is this combo box name

 2)if you use patch to update this lookup field

set the combo box's Items:

 

Filter(Contracts,status.Value="active")

 

Patch function should be like this:

 

Patch(...,....,
      {lookupfieldname:
                       {Value:DataCardValue5.Selected.'contract no',Id:DataCardValue5.Selected.ID},
        ...
       }
      )
//DataCardValue5 is this combo box name

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

@v-yutliu-msft Just tested it now and it seems I still have the delegation warning, I clicked on a contract number and submitted it but can't view it on the detailed screen. Why is that and how can I fix it. 

Hi @SandraAkujobi ,

Could you show me 

1)formulas in the combo box's Items, DefaultSelectedItems?

2)formulas in this field's datacard Default?

 

 

Best regards,

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

@v-yutliu-msft Attached is the formula for Items and Defaultselecteditems for the combobox.  Companycontracts is the list where the contractno are stored in and to check whether its active is from another column called "completed" and within that column the data type is a choice field so you pick between 0-1 and if 0 is chosen then the contract number is active. That's the reason to the formula used in the items formula box for the combo box.

Screenshot (9).pngScreenshot (11).png

 

Below is the Default settings for the datacard

Screenshot (10).png

Hi @SandraAkujobi ,

As i understood from the below your last comment.

you want to set the DefalutSectedvalue for the Dropdown.

but in can see the second Screenshot mention by you, there you set the Default properties for Datacard but instead of DataCard use the same formula for Combobox - DefaultSelectedPropeties like [ThisItem.FiledName]. that way. 
Hope This will work for you.

Thanks,
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@VijayTailor I tried that and that still doesn't work, the selected value isn't being displayed when submitted.

Hi what is the Error. it will be gr8 if you attach screenshot of your Issue

 @v-yutliu-msft    @VijayTailor As you can see on the edit screen the contract number picked isn't being displayed as well as the in the view screen (last image)

Screenshot (68).pngScreenshot (66).png

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,502)