palantir-foundryfoundry-code-repositoriesfoundry-functions

How do I convert an Object Array to a Foundry Object Set in my Function?


My Function’s input is an Object Array but I want to convert it to an Object Set to have searchAround capability. Is this possible within the Function? Or do I have to change the Function input to take an Object Set


Solution

  • You can create an Object Set within your Function as follows:

    Objects.search()
            .myObjectType()
            .filter(x => x.myObjectId.exactMatch(...myObjects.map(y => y.myObjectId))