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

Filter on Sharepoint Lookup field: data not saved

Hi every one,

 

I am new on PowerApps and I am trying to do the next:

* I have a SharePoint list B with a lookup column to the list , with a multi-select possibility.

* The list A have a field named Sector

* The list B have a field named Sector

I started personalizing the SharePoint Form of B with PowerApps to be able to do filtering on the list of choices in the lookup field when a sector is selected.

 

I modified my data source (Items) for the lookup column from:

Choices(B.MyLookupToA)

 

To:

Filter(A;Sector.Value=DataCardValue2.Selected.Value)

 

 

When I use my form: The filter is working well, but when I click on Save, the datas Is not saved in this column.

 

I hope the problem is clear for you, and I hope that someone have an idea on what is wrong in my approach.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Filter on Sharepoint Lookup field: data not saved

Thank you

View solution in original post

9 REPLIES 9
Highlighted
Frequent Visitor

Re: Filter on Sharepoint Lookup field: data not saved

Any help?

Highlighted
Super User II
Super User II

Re: Filter on Sharepoint Lookup field: data not saved

Assuming "Choices(A)" was originally the formula for the Items property then change to something like this:

 

Filter(Choices(A); Value = DataCardValue2.Selected.Value)

FYI: I don't think "Choices(A)" was the original formula because the original formula should have looked something like this Choices(DataSourceName.FieldName).



--------------------------------------------------------------------------------
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.
Highlighted
Frequent Visitor

Re: Filter on Sharepoint Lookup field: data not saved

Thank you for your response,

You are right, it was originally Choices(A.Sector)

But my problem is that I want to do filter on the field "Sector" and not the "Value"

I want something like this:

 

Filter(Choices(A); Sector = DataCardValue2.Selected.Value)

but it doesn't work with Choices function.

Highlighted
Super User II
Super User II

Re: Filter on Sharepoint Lookup field: data not saved

Easiest way to do this is the filter the Choices(). This way you get back a record that contains the Id and Value which is needed to save back to the lookup field. Based on the "Choices(A.Sector)" being the original formula then the filtered formula would look like this:

 

 

Filter(Choices(A.Sector), Value = DataCardValue2.Selected.Value)

 



--------------------------------------------------------------------------------
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.
Highlighted
Frequent Visitor

Re: Filter on Sharepoint Lookup field: data not saved

Hi,

Let me first correct my initial value of items of my lookup field, it was:

Choices(B.MyLookupToA)

Sorry about that.

 

However, hat you are proposing to me will fetch me the sectors and not my lookup column values.

 

What I want is B.MyLookUpField witch have the selected sector as Sector.

Highlighted
Super User II
Super User II

Re: Filter on Sharepoint Lookup field: data not saved

Does "Choices(B.MyLookupToA)" return a list of Sector values from the lookup or does it return another column value in the lookup list? My example only works with the value returned by the "Choices(B.MyLookupToA)", so if the value isn't the sector name you want to filter on then it won't work.



--------------------------------------------------------------------------------
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.
Highlighted
Frequent Visitor

Re: Filter on Sharepoint Lookup field: data not saved

Choices(B.MyLookupToA) doesn't return a list of sectors, it return a list of MyLookupToA as {Id,Value}

Thank you again.

Highlighted
Frequent Visitor

Re: Filter on Sharepoint Lookup field: data not saved

Thank you

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Filter on Sharepoint Lookup field: data not saved

Hi loullah

 

Is it okay if you can show a screenshot on how you built the collection from your datasource?

 

Thanks,

Sidacra

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,481)