cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dear_Harsh
Level: Powered On

Filter a choice with substring

Hi Experts,

 

I am customizing a SharePoint online child list using powerapps which has lookup column called ParentItem  to Parent list . Child list lookup column has choices like; 

 

Jan - 2018 - john.doe@contoso.onmicrosoft.com

Feb - 2018 - sara.key@contoso.onmicrosoft.com

Mar - 2018 - john.doe@contoso.onmicrosoft.com

 

I want to filter this child list lookup column based on logged in user's email using PowerApps. Below is my filter on lookup-choice column;

 

Filter(Choices('Timesheet Child List'.ParentItem), EndsWith(ParentItem.Value, User().Email) ).

 

If john is logged in user, then it should return choices 1 and 3.

 

It is coming up with blank values in the Choice dropdown.

Kindly guide.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter a choice with substring

Try this:

 

Filter(Choices('Timesheet Child List'.ParentItem), EndsWith(Value, User().Email) )


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
9 REPLIES 9
Dear_Harsh
Level: Powered On

Re: Filter a choice with substring

Someone please reply with a solution...

Highlighted
Super User
Super User

Re: Filter a choice with substring

Are there two blank values being returned or no results at all?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Dear_Harsh
Level: Powered On

Re: Filter a choice with substring

 

No result at all.

Is the filter formula correct ? 

Super User
Super User

Re: Filter a choice with substring

Try this:

 

Filter(Choices('Timesheet Child List'.ParentItem), EndsWith(Value, User().Email) )


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Dear_Harsh
Level: Powered On

Re: Filter a choice with substring

Checked. Still no result.

Dear_Harsh
Level: Powered On

Re: Filter a choice with substring

Super User
Super User

Re: Filter a choice with substring

The sample formula works in my test app. To troubleshoot you might want to put the Choices(...) into a collection to see exactly what is being returned and the table column name. That is the name that needs to be used in EndsWith(...). In my case the column name was "Value". The other thing to check is the email address that is returned by User().Email. For example in our tenant that function doesn't actually return our email address it returns our user account because we don't use our email address as a user account.

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Dear_Harsh
Level: Powered On

Re: Filter a choice with substring

Hi Jeff,

 

This is really strange, but on my 4th attempt today (3rd day), your given solution Filter(Choices('Timesheet Child List'.ParentItem), EndsWith(Value, User().Email) ) started working on its own.

 

Today, I checked the User().Email first and it was returning correctly in title field.

Then, I deleted the powerapps form, again customized and set it first to 

Filter(Choices('Timesheet Child List'.ParentItem), EndsWith(Value, User().Email) )   and saved-published . it didn't work.

then I tried with ParentItem and ParentItem.Value, it didn't work.

On 4th attempt I again set tried with Value in EndsWith. Saved and Published.

This time it worked on its own. What ?!!. Big Surprise...

 

Trust me, I did not touch any other value on the powerapps custom form. This was my first attempt with PowerApps, and have to admit I have lost a bit of faith in it due to this experience causing me to lose 3 precious working days.

 

Thanks !

 

anmvdberg
Level: Power Up

Re: Filter a choice with substring

Thanks, got mine working with your information.:

 

Selection on a choice field based on a text input field:

 

Filter(Choices(Confirmations.Werkplek_x0020_instructie_x0020_); StartsWith(Value; filterveld.Text))

 

Works great!!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 219 members 4,723 guests
Please welcome our newest community members: