# 13. Context awareness

Inforiver provides built-in context awareness i.e., any comments, notes, data input, or even headers that you add will be updated dynamically based on external filter or slicer selection. You can even select writeback payload with Power BI filters.&#x20;

When users enter comments or manually input data, the visual is unaware of the context, which can be set by a filter or a slicer in the report. In the example, notice how the comment entered for 'APAC' is still visible even after changing the filter to 'EMEA'.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FCXRFASVspwgcJZN8TpO9%2Fimage.png?alt=media&#x26;token=5eccd452-4b9f-4e3d-b072-fed9721dc0c8" alt=""><figcaption><p>Context unaware</p></figcaption></figure>

With Inforiver, you can configure filter context, which ensures that Inforiver visuals are aware of context changes and responsive to changes in filters i.e. the comments, data input, writeback payload, etc are dynamically updated. Let's look at how to set up filter context.

**Step 1**: Click on the **Filter Context** button in the Insert ribbon.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FwPuUCrzwen1Nqq0Y323E%2Fimage.png?alt=media&#x26;token=b88a0c64-fb52-49b4-9caa-e3a471fbbdd1" alt=""><figcaption><p>Filter context navigation</p></figcaption></figure>

**Step 2**: In the popup window, enter the table and field name for which context awareness is being set up. You can enter multiple tables and categories using the Add new link. In this case, we are setting up filter context for Subregions.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FX6IUyUsVIxw3s8WBxfYO%2Fimage.png?alt=media&#x26;token=e2f0f96f-75d3-4b74-b066-c34f74dbad9e" alt=""><figcaption><p>Add table and category</p></figcaption></figure>

**Step 3**: Inforiver automatically generates the DAX code based on the tables and categories entered. Click on the Generate Dax button and copy the DAX.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F5SHjquJV9EYIKSmkXRnU%2Fimage.png?alt=media&#x26;token=a24e7156-a841-4749-a8c1-d9e8d20e9593" alt=""><figcaption><p>Generate DAX</p></figcaption></figure>

**Step 4**: Create a new measure in your data model using the DAX generated in Step 3.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F7Tu5qjFcwW3iMiGRkulS%2Fimage.png?alt=media&#x26;token=c404916d-7938-42f5-a2d2-143d47c83837" alt=""><figcaption><p>Create new measure</p></figcaption></figure>

**Step 5**: Add the new measure to the Others (OM) visual parameter. It gets displayed in the report as well.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FKpG6Hbm5Gw6joB8yfS8I%2Fimage.png?alt=media&#x26;token=042feb65-8981-4051-ad36-cde5866ace05" alt=""><figcaption><p>Add measure to others parameter</p></figcaption></figure>

**Step 6**: Open the filter context configuration from the insert ribbon. You will now be able to select the new FILTERCONTEXT measure from the dropdown. You can enable/disable context awareness for notes and comments using the toggle switches. Click on save.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FafQMatwcMITLeKA06NtF%2Fimage.png?alt=media&#x26;token=cf71a619-4b7f-4477-894a-86565cae67b5" alt=""><figcaption><p>Filter context configuration</p></figcaption></figure>

Let's see the context awareness feature in action by adding a notes column and setting a filter on APAC subregions.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FVtxcJJknICE6bMSiLYoa%2Fimage.png?alt=media&#x26;token=8c83827b-9916-485e-a776-b4512bbd5931" alt=""><figcaption><p>Add notes</p></figcaption></figure>

Notice how the note is removed when we change the filter from APAC to EMEA.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FVBufQXBnJUxoJUIpc5Iy%2Fimage.png?alt=media&#x26;token=3b221bad-649a-4319-8653-55e16f11edb8" alt=""><figcaption><p>Filter context in action</p></figcaption></figure>

### 1. Context awareness in report headers

Slicer selections will be reflected in header presets as well, if your report has been configured for filter context.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FRsgKzapEJrPcf0ghZrup%2F7.1.%20Filter%20context%20header%20preset.png?alt=media&#x26;token=3b62f757-199f-44df-a732-4be50ff664bb" alt=""><figcaption><p>Filter context for header presets</p></figcaption></figure>

### 2. Context awareness in writeback

The filter selections are captured in the writeback table as separate columns. In the example below, the Segment and Region selections are captured as part of the writeback.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FTLc8IFruZHfZ48aRU7WW%2Fimage.png?alt=media&#x26;token=0e081735-6cbc-4a7b-a64a-34046611bb17" alt=""><figcaption><p>Writeback for Home Office + West selection</p></figcaption></figure>

When the Segment and Region selection is changed to Corporate + Central, the notes and comments are inserted as separate rows in the snowflake destination and tagged against the changed categories.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fut0X7t2cFWgQYxqJoAXp%2Fimage.png?alt=media&#x26;token=850f36de-852e-479b-830c-c6baa2c41905" alt=""><figcaption><p>Writeback for Corporate + Central selection</p></figcaption></figure>

### 3. Context awareness for data input fields

With Inforiver, manual data entry fields like textboxes, dropdowns, or numeric input will also be responsive to slicer selections. Notice how the data inputs change according to the filter selections in the gif below.

{% hint style="info" %}
When working with context awareness, you need to select a category(ies) in the external filters for writeback and data input to be enabled.
{% endhint %}

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FI8Ws4sYp2Kioc0FsQePj%2F2.1.%20Filter%20Context%20-%20data%20input%20gif.gif?alt=media&#x26;token=7a0076f7-0c03-41f1-a781-a4b5b1eb157a" alt=""><figcaption><p>Data inputs changing in response to filter selections</p></figcaption></figure>

### 4. Context awareness for writing back data input fields

The data input cells that are written back will also be determined based on filter selections.  In the screenshot below, the report has 3 data input columns: Benchmark, Progress, and Status. Notice how the data input fields were written back to the snowflake destination for the Consumer + January + First Class selection.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F8qlRRMWdazbdp2DbnEhU%2Fimage.png?alt=media&#x26;token=98c2544e-5258-4695-92e1-71a03548a82d" alt=""><figcaption><p>Writeback for data input columns based on external filter selection</p></figcaption></figure>

When the selection is changed to Home Office + October + Standard Class, the data inputs corresponding to the selection are written back as shown below. The data input fields for each filter selection are captured as separate rows in the destination.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fofm3kJGkmIVf6vIlFm7b%2Fimage.png?alt=media&#x26;token=03e2e5ed-fda4-41b6-acee-692891fe3584" alt=""><figcaption><p>Writeback for data input fields after changing the selection</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inforiver.com/~/changes/mS6jwvARNLHpKqBa4cT9/working-with-inforiver/13.-context-awareness.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
