0

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

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

Thanks.

1

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": "Lee@tenant.onmicrosoft.com"
            }
        ],
        "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"
            }
        ]
    }
  • 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" } ], – Fabio Valencia Aug 23 '18 at 15:10
  • 1
    Check my update. – Lee_MSFT Aug 24 '18 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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