1

How can I Expand a Multiple Lookup field with Microsoft Graph.

I need to get all fields from a multiple lookup field.

Thanks.

2 Answers 2

2

Per my testing, you could use V1.0 to get lookup addition filed.

For example:

https://graph.microsoft.com/v1.0/sites/siteid/lists/dc0935d2-8cda-4bf2-b896-bb43e39bfbdb/items/2?expand=fields

Return value:

"MultiLookup": [
            {
                "LookupId": 6,
                "LookupValue": "a"
            },
            {
                "LookupId": 7,
                "LookupValue": "b"
            },
            {
                "LookupId": 8,
                "LookupValue": "ccc"
            }
        ],
        "Sponsor": [
            {
                "LookupId": 10,
                "LookupValue": "Lee",
                "Email": "[email protected]"
            }
        ],
        "MultiLookup_x003a_Created": [
            {
                "LookupId": 6,
                "LookupValue": "2017-10-19T03:14:50Z"
            },
            {
                "LookupId": 7,
                "LookupValue": "2017-10-19T03:17:25Z"
            },
            {
                "LookupId": 8,
                "LookupValue": "2017-10-19T05:14:24Z"
            }
        ]

You could try to specify the return fields also.

?expand=fields($select=Title,MultiLookup,MultiLookup_x003a_Created)

Update:

field setting enter image description here

Endpoint

/items/2?expand=fields($select=Title,MultiLookup,MultiLookup_x003a_MyNumber)

Return value

"fields": {
        "@odata.etag": "\"81e83b50-db18-47b0-b594-75795c403ee0,3\"",
        "Title": "test1",
        "MultiLookup": [
            {
                "LookupId": 6,
                "LookupValue": "a"
            },
            {
                "LookupId": 7,
                "LookupValue": "b"
            },
            {
                "LookupId": 8,
                "LookupValue": "ccc"
            }
        ],
        "MultiLookup_x003a_MyNumber": [
            {
                "LookupId": 6,
                "LookupValue": "20.0000000000000"
            },
            {
                "LookupId": 7,
                "LookupValue": "21.0000000000000"
            },
            {
                "LookupId": 8,
                "LookupValue": "22.0000000000000"
            }
        ]
    }
2
  • I tried It, but the result is this: "Cargo": [ { "LookupId": 3, "LookupValue": "Quality" } ], I need to get all fields of "Cargo", but this only gets "LookupId and LookupValue", I need to get the other fields of the other list as well: "Cargo": [ { "LookupId": 3, "LookupValue": "Quality", "Code": "COD_01" } ], Aug 23, 2018 at 15:10
  • 1
    Check my update.
    – Lee
    Aug 24, 2018 at 7:18
0

Although this is an old question, I would also like to point out that the Graph V1 API currently limits the characters for internal fields name to 32. I have not found any official documentation on the behavior but for lookup fields with length greater than 32, just truncate the extra characters.

Your Answer

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

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