Why I can't use Session Variable on my Logic Server Action
Application Type
Traditional Web

Hi All,

I try to create Timer. Inside logic from Timer (Server Action) I use aggregate to filter data with Session Variable to get  data byId and update the data. But if I test from UI, showing error cannot update with key 0.

What should I do?

Regards.

Hi Kane,

As Timer runs in different process you will not get the session variable there. instead you can pass the session variable data as input parameter to the timer (if you are triggering the timer from your web app) or you need to store the session variable in DB (if the timer is triggering from a scheduler)  and then you can use it in the aggregate.

Best Regards

Devendra







Hi Devendra,

I try to pass session variable data to my server action timer but still not working

Hi Kane,

From where you are triggering timer from web app or from scheduler?




Yes we cannot pass the input from web app we can only wake up the timer. better store the session variable in DB from web app and fetch the value from DB from timer to use it.



Hi,

Last I try to store my SV on DB and I fetch from Logic Timer and get same result.

I was earlier thinking of passing the input data while wake up the timer from web app but unfortunately outsystems doesn't allow it . check the below post  

https://www.outsystems.com/forums/discussion/73182/is-it-possible-to-specify-a-input-parameter-when-wakeup-a-timer/

Generally speaking, timers are used for bulk operations. 


So if you have a table that you need to iterate and perform tasks for each record, then timers are your best friend.

If you want to perform some tasks on 1 item asynchronously, then you probably have a server action with an input parameter (or a session variable, if you prefer that) and you could consider using a (BPT) process, which does allow you to set an input parameter for your action.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.