# Replacement for IsFieldNeeded

**URL:** https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342
**Category:** Development
**Created:** [August 1, 2019, 3:43pm UTC](https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342 "2019-08-01T15:43:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [August 1, 2019, 3:43pm UTC](https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342/1 "2019-08-01T15:43:25Z")

</div>

Is there a replacement attribute or method for the IsFieldNeeded test in vtkCPInputDataDescription given that it is deprecated?

This test seems ubiquitous in Catalyst examples, but I can’t figure out what I am supposed to do now to test if I need to add a field.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [August 1, 2019, 4:29pm UTC](https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342/2 "2019-08-01T16:29:24Z")

</div>

The old signature for the `IsFieldNeeded` method only took in a const char\* for the name of the field and that was deprecated since it wasn’t descriptive enough. The new, replaced method is actually still called `IsFieldNeeded` but now also takes in a type which corresponds to the vtkDataObject::AttributeTypes enum. The basic idea here is that a simulation could provide the same field name in both a point data field and a cell data field and in the old `IsFieldNeeded` form there was no way of knowing which one the adaptor should provide.

---

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [August 1, 2019, 4:38pm UTC](https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342/3 "2019-08-01T16:38:06Z")

</div>

> [@Andy\_Bauer](#):
>
> vtkDataObject::AttributeTypes

Thanks, Andy!! It will be a relief to clean up my logs again… Are there any documented examples using the new arguments?

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [August 1, 2019, 6:43pm UTC](https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342/4 "2019-08-01T18:43:13Z")

</div>

If you do a search through the examples under the `Examples/Catalyst` directory of the main ParaView source code for `IsFieldNeeded` you’ll see some examples.

---

<div class="post-metadata">

### Author: ![kschau](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@kschau](https://discourse.paraview.org/u/kschau)
#### Post date: [August 4, 2019, 10:22am UTC](https://discourse.paraview.org/t/replacement-for-isfieldneeded/2342/5 "2019-08-04T10:22:17Z")

</div>

Anyone coming across this in the future, the usage is just

isFieldNeeded(“Pressure”, vtkDataObject::POINT)

or CELL or whatever your data type
