0

I have three Sharepoint lists, One for person, one for furniture, and one for house.

The house table has a lookup column that links to the person (PersonName) table, and the person table has a lookup column that links to the furniture (FurnitureName) table.

I am creating a form and connected it to the house table, among the fields are PersonName and FurnitureBought. Currently, the dropdown for FurnitureBought displays all furnitures. I want it set up so that when I set the dropdown for PersonName, only the Furnitures that are assigned to that person is the only thing visible on the dropdown. When I set it to:

Lookup('FurnitureList', FurnitureName.Value = PersonNameDropdown.Value)

The FurnitureBought dropdown is empty.

1 Answer 1

1

With the help of Gallery and Collection you can fill lookup values in combo box/dropdown.

  1. add a gallery with a Data Source "Person". Set visible property off gallery off

  2. Select your Form>>Properties, Edit Fields and Add a custom card>> then go to insert and select combo box.

  3. Click Outside of Form, Go to insert and insert button.

  4. Insert below code on OnSelect event, change names according to your controls.

Clear(colPerson1);
ForAll(
    
 Gallery4.AllItems  As GalleryItem,
    
    Collect(
        colPerson1,
        {
            Title:  GalleryItem.Name,
            FurnitureBought: GalleryItem.FurnitureBought.Value
        }
    )
)

5. Change your button visibility to off.

6. Set Items property of your combo box inserted in step 2 as below

Filter(colPerson1,Title=DataCardValue2.Selected.Value)

7. On OnChange property of PersonName to execute the code on button

Select(Button4)

On changing Person Name , Furniture Brought will show only list of furniture bought by this person.

enter image description here

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.