# What is the difference between two approaches to get the dataset on the client side?

**URL:** https://discourse.paraview.org/t/what-is-the-difference-between-two-approaches-to-get-the-dataset-on-the-client-side/14993
**Category:** Development
**Created:** [July 5, 2024, 7:21am UTC](https://discourse.paraview.org/t/what-is-the-difference-between-two-approaches-to-get-the-dataset-on-the-client-side/14993 "2024-07-05T07:21:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [July 5, 2024, 7:21am UTC](https://discourse.paraview.org/t/what-is-the-difference-between-two-approaches-to-get-the-dataset-on-the-client-side/14993/1 "2024-07-05T07:21:51Z")

</div>

Hello!

What is the difference between the two ways to get the dataset on the client side?

```auto
  auto sourceProxy = pqActiveObjects::instance().activeSource()->getProxy();
  auto algorithm = sourceProxy ? vtkAlgorithm::SafeDownCast(sourceProxy->GetClientSideObject()) : nullptr;
  auto dataset = algorithm ? vtkDataSet::SafeDownCast(algorithm->GetOutputDataObject(0)) : nullptr;

```

And

```auto
  using vtkSrcPrxyPtr = vtkSmartPointer<vtkSMSourceProxy>;
  vtkSrcPrxyPtr filter{};
  vtkSmartPointer<vtkDataSet> dataSet{};
  auto proxyManager = vtkSMProxyManager::GetProxyManager()->GetActiveSessionProxyManager();
  int sourcePortNumber = 0;

  if (source && (filter = vtkSrcPrxyPtr::Take(vtkSMSourceProxy::SafeDownCast(proxyManager->NewProxy("filters", "ClientServerMoveData")))))
  {
    if (auto inputProperty = vtkSMInputProperty::SafeDownCast(filter->GetProperty("Input")))
    {
      inputProperty->RemoveAllProxies();
      inputProperty->AddInputConnection(source, sourcePortNumber);
    }
    vtkSMPropertyHelper{ filter, "OutputDataType" }.Set(VTK_POLY_DATA);
    filter->UpdateVTKObjects();

    //source = filter;
    sourcePortNumber = 0;
  }

  if (filter)
  {
    filter->UpdatePipeline();
    dataSet = vtkDataSet::SafeDownCast(vtkAlgorithm::SafeDownCast(filter->GetClientSideObject())->GetOutputDataObject(sourcePortNumber));
  }

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 5, 2024, 7:37am UTC](https://discourse.paraview.org/t/what-is-the-difference-between-two-approaches-to-get-the-dataset-on-the-client-side/14993/2 "2024-07-05T07:37:15Z")

</div>

The first is working only in builtin mode or with client side object, the second is working in client/server mode with server side object.
