0

I have 2 SharePoint lists:-

  1. Parent_1.
  2. Child2 . has a ParentId field which store the Parent_1 id in a single line of text.

Now i want to do these 2 operations:-

  1. Build a collection which contain all the Parentid from the Child2 list.
  2. set the Items property of a ComboBox to only contain the Parent_1 records which have an Id inside the collection. In other words the ComboBox should only contain Parent_1 records which are assigned to at-least one Child2 record.

Now i tried this Appraoch-1

Inside the Screen Onvisible, i built the following collection:-

ClearCollect(childcol,ShowColumns(Child2,"ParentId")); 

and inside the Item property i tired the following, but i got a delegation warning on the "in" operator:-

Filter(Parent_1, ID in childcol.ParentId).Title 

Then i tried Appraoch-2, where inside the screen OnVisible, i build the following 2 collections:-

ClearCollect(childcol,Child2, ["ParentId"]);
ForAll(childcol,Collect(parentcol,Filter(Parent_1,ID=childcol[@ID]))); 

then inside the Items property of the Combobox, i define the following:-

parentcol.Title 

I did not get any delegation warning but the ComboBox will be empty.

any advice how i can Get all the items inside SharePoint list which have their Ids inside a collection without raising any delegation errors

1 Answer 1

0

Try to use this -

ClearCollect(
    colChildDropDown,
    ForAll(
        Parent_1 As _items,
        If(
            !IsBlank(
                LookUp(
                    Child2,
                    ParentId = _items.ID
                ).ParentId
            ),
            {
                ID: _items.ID,
                Value: _items.Title
            }
        )
    )
)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.