cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
loullah
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

Thank you

View solution in original post

9 REPLIES 9
loullah
Frequent Visitor

Any help?

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.

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.

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.

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.

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.

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

Thank you again.

Thank you

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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