Global Script Variable is not getting refreshed with updated data

Hello Friends,

I have created one variable with data type as string named ack10 and set the code to get the data from data source

ack10 = DATA_SOURCE_NAME.getDataAsString("_W66pUMs0Eead6IBmqhaV5Q", {

"_kguxAcsvEead6IBmqhaV5Q": "5-10 Mins"

});

I have also set the timer after every 15 minutes to refresh the data source along with clear filter

DATA_SOURCE_NAME.reloadData();

DATA_SOURCE_NAME.clearAllFilters();

After reloading datasource an updated data is available but variable is not getting updated with new value. I can see that data source is having an updated data but variable is not updated with latest record. I think I am missing some code to refresh the variables, please assist.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 27, 2017 at 01:26 PM

    Hi Harshil,

    You should place your script code ack10 = DATA_SOURCE_NAME.getDataAsString("_W66pUMs0Eead6IBmqhaV5Q", {"_kguxAcsvEead6IBmqhaV5Q": "5-10 Mins"}); inside the "On Result Set Changed" event of the data source so it is updated with each refresh.

    If you are displaying the value of ack10 in a component such as the Text component, then a better approach would be to bind the specific cell in the data source (same one as defined in getDataAsString) directly to the Text property of the Text component so that it automatically updates whenever the data source changes.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 27, 2017 at 12:16 PM

    Are you filling your variable again after data reload? I would have thought that you need to execute the ack10 line of code to fill your variable again.

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content