TobyLai
Novice

Is lookup() function supporting for cross site now?

Jump to solution

I'm trying to use the lookup() function to access a list from a different site.

I'm tried to use lookup("/sites/bbb|listName", "Title","xxx","Title")  in site ("/sites/aaa/xxx"), and I got #Value!

I got a error message: [/sites/bbb|listName-xxxxxxxxxxxxxxxxxxxxxx] - A request for SharePoint data failed. Error details: List 'listName' does not exist at site with URL 'https://xxxxxxx.sharepoint.com/sites/aaa/xxx'.

 

And I researched this post, it said O365 does not supported for cross site yet in 2016.

(Ref: https://community.nintex.com/t5/Nintex-for-Office-365-Forum/Lookup-runtime-function-using-a-list-fro... )

 

However, I found the current limitation which is no mention about the lookup function is not able to access another site, and the Lookup control will now query across site collections within then tenant.

(Ref: https://community.nintex.com/t5/Responsive-Forms/New-Responsive-Office365-Current-limitations/m-p/89...)

 

Hence, Is lookup() function supporting for cross site now? Thanks a lot.

Labels: (1)
0 Kudos
Reply
3 Replies
nico
Explorer

Re: Is lookup() function supporting for cross site now?

Jump to solution

Hi,

 

On new responsive Forms :

Yes the function "Lookup" support the corss site.

Warning : There is a strange (bug ?) behaviour. You need to install the "Nintex Forms for O365" app on your target site, otherwise, you will never be able to retrieve lists from your target site.

 

On Classic (and old Responive form) : No the corss site is not supported. Between different site collection it's not supported. On the same site collection i thinks it's supported, but I'm not 100% sure.

 

ps : in the link of your previus post, it's the lookup control that support the cross site. 

 

In new responsive : the syntaxe of your function is wrong. There is a dedicated parameter for the URL of you site : 

https://help.nintex.com/en-US/Office365/Designer/Functions/Lookup.htm

 

Lookup("Invoices", "ID", "1045", "Title","/sites/Sales/APAC", ",")

 

View solution in original post

0 Kudos
Reply
TobyLai
Novice

Re: Is lookup() function supporting for cross site now?

Jump to solution

Hi nico,

 

I tried the lookup() function in the new responsive form, and it is successful to get the value from another site.

However, as you mentioned, the classic form is not supporting the cross site lookup(), is it possible to  achieve the cross site effect in classic form in another way? thanks a lot.

 

0 Kudos
Reply
nico
Explorer

Re: Is lookup() function supporting for cross site now?

Jump to solution

Yes it's possible.
This can be done with JavaScript and CSOM or SharePoint Rest API
You will need to interact with the "SP.ProxyWebRequestExecutorFactory" to get your crosssite client context and after made some query to your remote site.

Or you can use the SharePoint Search to get your data from your target site. You will steel need to use JavaScript and CSOM / SharePoint REST API. What is interesting is that you can use your current context to interact with the search (and bring up info from a remote site).

 

To get your current context in Classic Forms, you can use this code: 

 

var pollSP;

NWF.FormFiller.Events.RegisterAfterReady(function () {
    pollSP = setInterval(checkSPLoad, 500);
});

function checkSPLoad() {
    if (clientContext) {
        window.clearInterval(pollSP);
        onSPLoad();
    }
}

function onSPLoad() {
     //Our code must come here
}

 

https://community.nintex.com/t5/Community-blogs/Hide-Edit-Item-button-if-user-is-not-allowed-to-edit...

 

 

0 Kudos
Reply