Unable to access 'chat1' since it is scoped to 'XPage' and 'query1' is scoped to the app

Hello,

I'm creating my own chat application and have created a query to generate chat responses, but am getting the following message:

"Unable to access 'chat1' since it is scoped to 'XPage'. 'query1' is scoped to the app."

I've tried moving the query from global to local as well but that didn't work either. Would really appreciate any help on fixing this!

Here's the tutorial I'm following: https://www.youtube.com/watch?v=S4KfIkZoQeE

Hello @Anupriya_Dubey!

Thank you for sharing the tutorial video. I have a couple other questions to better understand the situation.

Are you using a multipage app? What does 'query1' do? Could you share a screen shot of where you are getting the error message?

Are you taking data from the 'chat1' component to run 'query1'?

I'm seeing a similar issue. I have a multipage app. One of the pages has a table. I have a list in a drawer that filters options based on the selected row. This the error I'm seeing:
Screenshot 2024-10-09 at 9.00.42 AM

I can access the table just fine with other components.

Hello @PraxBlackhorn!

Thank you for sharing the screen shot, that helps a lot.

It looks like you might be able ti fix that bug by making 'table_allContacts' and the query that fetches its data globally scoped.

From the error message, 'table_allContacts' scope is limited to only components on the 'Contacts' page.

It seems that 'NewCampaign_campaignsList' is globally scoped as it mentions it is scoped to the app. So any information in that query/component is able to be shared to other pages on the app.

Check out our docs for more information on scoping in multipage apps as it can get a little confusing :sweat_smile:

Going through the docs it seems that "All other frames (e.g., Modal and Drawer) are page-scoped and only available within the app in which they reside." So you might need to have another way to query the selected row data :thinking:

@Anupriya_Dubey I have a hunch that while 'query1' is scoped to the app and can be accessible from anywhere within the app, that the 'chat1' component is limited to a single page's scope (XPage) so you might need to expand the scope on 'chat1' :crossed_fingers: