# Refresh View Button

![a Table View with the Keyword Search option enabled and Refresh button](/files/-MY6sBfkmLsYegfW_YF1)

Sometimes Knack will fail or be slow to update a record table, especially if you have a same-page multi-submit form, or a modal multi-submit form where a user can submit the form many times, creating new records until done. If data does not show up in table or update, a page refresh would be necessary. Additionally, when records are added or updated often, the refresh button reinforces the user that they are working with all available and updated records.

### The JS

```javascript
/***************************/
/*** Refresh View Button ***/
/***************************/
$(document).on("knack-view-render.view_321", function (event, page) {
  var button = $(
    "<span style='width: 2em'></span>" +
    "<button id='refresh-view_321' style='border-radius: .35em' class='kn-button is-primary'>" +
    "<i class='fa fa-refresh'></i>" +
    "<span style='width: .5em'></span>Refresh Table</button>"
  );

  button.insertAfter(//places button next to keyword search option
    $("#view_321").find("form.table-keyword-search").find("a")[0]
  );

  $("#refresh-view_321").click(function (e) {
    e.preventdefault();
    Knack.views["view_321"].model.fetch();
  });
});
```

### The CSS

None needed 😎

### How to Implement

Adjust the View ID's with your own

```
view_2698
```

and make sure that the Keyword Search option is enabled for your View

![](/files/-MY6upu7PCjsJkrfPgaV)


---

# 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://atd-dts.gitbook.io/atd-knack-operations/knack-code/functionality/refresh-view-button.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.
