# How to refresh current summary view

**URL:** <https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079>\
**Category:** Help me!\
**Created:** [October 2, 2020, 8:14pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079 "2020-10-02T20:14:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [October 2, 2020, 8:14pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/1 "2020-10-02T20:14:13Z")

</div>

Hi team,

In my users collection, I have a summary view like this one:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/cad7c7e3a5a9047af274a5a465f92c39043f3adc.png)

Under Card, we can see the Smart field reference of the `cards` collection (hasOne association from `users` to `cards` collection). This smart field is built in part from the card’s status.

The “Get card status update” action is requesting a remote status in order to update the status field of the user’s card.

How to refresh the current `user details` section in the called action.

The end of the route called is currently containing:

```javascript
    return res.send({
      success: `Operation completed. ${message}`,
    });

```

I tried this:

```javascript
    return res.send({
      success: `Operation completed. ${message}`,
      refresh: { relationships: ['user_details'] },
    });

```

But it did not work as user\_details is not a relationship but the collection itself.  
Is there a simple way to do it please?

Thanks.

My current setup:

```javascript
    "database_type": "postgres",
    "liana": "forest-express-sequelize",
    "liana_version": "6.3.11",
    "engine": "nodejs",
    "engine_version": "12.13.1",
    "framework": "express",
    "framework_version": "^4.17.1",
    "orm_version": "4.44.0"

```

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [October 5, 2020, 2:11pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/2 "2020-10-05T14:11:36Z")

</div>

Hello @Louis-Marie !  
Please tell me if I understand your problem: You have a smart-field composed from data from both your database and a remote API call, and when you click on your smart action you want the field to be refreshed ?

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [October 5, 2020, 2:39pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/3 "2020-10-05T14:39:04Z")

</div>

If that’s the case can you try with

```javascript
  return res.send({
      success: `Operation completed. ${message}`,
      refresh: { relationships: ['cards'] },
    });

```

---

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [October 5, 2020, 4:50pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/4 "2020-10-05T16:50:07Z")

</div>

Hi @anon94532230

You’ve got my problem.

Unfortunately, your solution does not work.  
The card smart field (used as reference) is still not refreshed at the end of my action.

Any other idea?

Thanks.

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [October 6, 2020, 9:03am UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/5 "2020-10-06T09:03:32Z")

</div>

Hi @Louis-Marie,

Could you try replacing the `'cards'` relationship in the solution Nicolas gave you by `'card'`.

If ever that’s not working, could you answer those questions so I can try to reproduce your issue on my end:

- Is `cards` a basic collection or a smart collection?
- You said that that card was a smart field, could you share with me the definition of this smart action?

I hope this will help you!

---

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [October 6, 2020, 10:31am UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/6 "2020-10-06T10:31:37Z")

</div>

Hi @anon37102731,

> Could you try replacing the `'cards'` relationship in the solution Nicolas gave you by `'card'` .

I tried, but nothing changed.

> Is `cards` a basic collection or a smart collection?

It is a basic one (a native SQL table)

> You said that that card was a smart field, could you share with me the definition of this smart action?

Please find below the main information regarding `users`, `cards` and things related to that issue:

```javascript
db.users.hasOne(db.cards);
db.cards.belongsTo(db.users, { as: 'user', foreignKey: 'user_id' });

Liana.collection('cards', {
  fields: [
    // ... some other smart fields ...
    {
      field: 'CHID_and_status', // used as Reference
      type: 'String',
      get: (card) => {
        if (card.remote_id && card.status === 'Deposit Only') {
            return `${card.remote_id} / 🔥 Locked`;
        } else if (card.remote_id && card.status) {
            return `${card.remote_id} / ${card.status}`;
        } else {
            return null;
        }
      },
    }, 
  ],
}

Liana.collection('users', {
  actions: [
    // ... many other actions ...
    { name: 'Get card status update',
      type: 'bulk',
      endpoint: 'forest/actions/users/get_card_status_update',
    }, 
  ],
}

```

Basically, the smart action itself requests the remote status card, and updates the local status of the native cards table. The update is made without any problem. When I reopen the `users` record, the new status is correctly displayed.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [October 6, 2020, 2:05pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/7 "2020-10-06T14:05:47Z")

</div>

I’ve eventually been able to understand and reproduce your issue.

Reference fields are designed to change the displayed content of a link to another resource. Unfortunately when performing a refresh after a smart action, only the updated id is tracked to update the link correctly (if you had change the related card itself and not its status, the link would have been updated correctly. But not the link content unless it’s the id itself)

As this behavior is not something previously handled by ForestAdmin and then broken I cannot make a bug report out of it. But I’ll flag it as a feature request from you and hand it over to our product team.

Best regards

---

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [October 6, 2020, 4:45pm UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/8 "2020-10-06T16:45:13Z")

</div>

Hi @anon37102731

Thank you for your answer.

I understand your point of view, linked to technical constraints.

However, for a user’s point of view, he has a screen that shows a value (the smart field reference), and the updated value is not reflected after execution of the action. IT IS considered as a bug by the final user.

In this context, it cannot be just considered as a new feature request.  
From my point of view, I would consider this as a misconception issue.

But, of course, things has to be improved little by little.  
I would just kindly ask you to consider this as an issue not an improvement request.

Many thanks for your help.  
Best regards

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [October 7, 2020, 9:11am UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/9 "2020-10-07T09:11:51Z")

</div>

Hi @Louis-Marie,

We found the issue and created an issue for that bug.  
You can keep track of the status here:

https://share.clickup.com/t/h/8yu5cq/SIB0I4ATDI5E3NZ

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [October 12, 2020, 8:04am UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/10 "2020-10-12T08:04:55Z")

</div>

Hey @Louis-Marie ,

We released the fix this morning 😉

---

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [October 12, 2020, 9:45am UTC](https://community.forestadmin.com/t/how-to-refresh-current-summary-view/1079/11 "2020-10-12T09:45:35Z")

</div>

Hi @anon62739609

That works as expected. Perfect.

Thank you very much!  
Best regards
