# How to pass a context value to ui-table

**URL:** <https://discourse.nodered.org/t/how-to-pass-a-context-value-to-ui-table/47709>\
**Category:** Dashboard\
**Created:** [27 June 2021 07:46 UTC](https://discourse.nodered.org/t/how-to-pass-a-context-value-to-ui-table/47709 "2021-06-27T07:46:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasro](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nasro/32/43232_2.png) [@Nasro](https://discourse.nodered.org/u/Nasro)\
**Post date:** [27 June 2021 07:46 UTC](https://discourse.nodered.org/t/how-to-pass-a-context-value-to-ui-table/47709/1 "2021-06-27T07:46:29Z")

</div>

Hi  
I have this tabulator config how can I pass a value to this function  
I try this but dosen't work for me  
i am using function node that inject this msg to ui-table node

```auto

var min_justifi=flow.get("min_justifi");
msg.ui_control = {
{
            "title": "temps_arret",
            "field": "temps_arret",
            "editor": "output",
            "formatter":"function(cell, formatterParams){var value = cell.getValue(); if(Number(value.split(':')[0])*3600 + Number(value.split(':')[1])*60 + Number(value.split(':')[2])>min_justifi){return \"<span style='color:red; font-weight:bold;'>\" + value + \"</span>\";}else{return value;}}"
        }

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 June 2021 10:13 UTC](https://discourse.nodered.org/t/how-to-pass-a-context-value-to-ui-table/47709/2 "2021-06-27T10:13:01Z")

</div>

Try...

```auto
var min_justifi=flow.get("min_justifi");
msg.ui_control = {
{
            "title": "temps_arret",
            "field": "temps_arret",
            "editor": "output",
            "formatter":"function(cell, formatterParams){var value = cell.getValue(); if(Number(value.split(':')[0])*3600 + Number(value.split(':')[1])*60 + Number(value.split(':')[2])> " + min_justifi + "){return \"<span style='color:red; font-weight:bold;'>\" + value + \"</span>\";}else{return value;}}"
        }

```

---

<div class="post-metadata">

**Author:** ![Nasro](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nasro/32/43232_2.png) [@Nasro](https://discourse.nodered.org/u/Nasro)\
**Post date:** [27 June 2021 11:08 UTC](https://discourse.nodered.org/t/how-to-pass-a-context-value-to-ui-table/47709/3 "2021-06-27T11:08:46Z")

</div>

its work thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 July 2021 11:09 UTC](https://discourse.nodered.org/t/how-to-pass-a-context-value-to-ui-table/47709/4 "2021-07-11T11:09:18Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
