> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/control/coherent-assistant/working-with-xcalls.md).

# Working with XCalls

Xcalls allow users to reference content and data from spreadsheets on Coherent Spark from within Control files. These references are established in the spreadsheet prior to conversion to Control

### Setting up XCalls

Set up the referenced Spark service before converting the workbook to Control. See [Call Spark service APIs](https://docs.coherent.global/build-spark-services/call-spark-service-apis).

### Recalculating Xcalls within a Controlled file

To calculate XCalls, select **Recalculate XCall** on the screen below.

<figure><img src="https://2002559430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iT8EXgVSEYEufmp7Bne%2Fuploads%2FiklokPjuiVNF3gq9eIe7%2Fimage.png?alt=media&amp;token=9ea33c97-c1d9-4d83-b84c-e45cd53b0867" alt=""><figcaption></figcaption></figure>

### Login for XCall - Using XCalls from different Spark environments

In some situations, users may need to reference data on different Spark environments (e.g. reference production vs non-production data). In this scenario, the "Login for Xcall" function allows users to login to this separate environment to execute the XCall and retrieve the relevant data.

To access this, please use the top-left menu inside the Control tab of the Coherent Assistant and click **Login for Xcall**.

<figure><img src="https://2002559430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iT8EXgVSEYEufmp7Bne%2Fuploads%2FCAZxt4iQLX9wir2lvWji%2Fimage.png?alt=media&amp;token=5fa475cc-9a1f-4eeb-a92a-9f9664843db8" alt=""><figcaption></figcaption></figure>

The user can then log in to the appropriate Spark environment by typing in the relevant URL (via a pop-up). A brief message will appear once logged in.

<figure><img src="https://2002559430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iT8EXgVSEYEufmp7Bne%2Fuploads%2F12CsvPqYPBjqpmvT4MSp%2Fimage.png?alt=media&amp;token=381d6630-54c6-49be-8bf4-f27aa0dc32cd" alt=""><figcaption></figcaption></figure>

Users are also able to see where they are logged in to for Xcalls by clicking the same menu.

<figure><img src="https://2002559430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iT8EXgVSEYEufmp7Bne%2Fuploads%2Fy6KQB3ZFEvTbF1Z2AHPk%2Fimage.png?alt=media&amp;token=d3568bbe-8d8d-44ef-ab0a-9232bce4c4db" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please note: Once a session is cancelled by closing the file or opening another control file, users will need to log-in to the xcall session again. This is done to prevent data being accidentally being used from the wrong environment (e.g. using non-production data).
{% endhint %}

Future enhancements will be made to establish more direct connections at the platform level.
