Screen Local Variable always get default value on screen action

Hi all, 

I have a screen local variable to stored list "sub-category" as JSON. 

I have trigger from "Sub-category" Web-block to return list JSON value and on event handler I assign to screen local variable.

I used feedback message to show value of local variable in Event Handler and it showed correct value.

But when i click on Save button, the value of local variable is blank (default value).

How can i get correct value in Save action?

Please help!

Hi Hung,

Are you able to share the screen shot of the action and assignment,

Also check the method of an action of button.

Kind Regards,

Hi Komal,

here is my actions

Hi Hung,

Here you said  "I have a screen local variable to stored list "sub-category" as JSON. ", what is data type of your local variable?


as screen shot. The local variable is "VarTypeOfRMTableAsJSON" with Text data type.

I tried add Expression to show local variable to screen and using Ajax to refresh it after assign.

It worked. I can get correct value in Save action.

Can you tell me why?

I have implemented same thing, you can check here, https://komal-k.outsystemscloud.com/Block_Event/DisplayJSON.aspx click on get value, you will get the value which block has sent to screen then click on save will return the same value 

Kind Regards,


BlockEvent.oml

Hi Komal. 

I updated this oml to use editable table then it's not working as expected.

https://hung-nguyen15.outsystemscloud.com/Block_Event/DisplayJSON.aspx

The oml here!

BlockEvent.oml

So you want,  

1. Add record in editable table in block, 

2. Click on correct tick

3. Event called and JSON valued saved into Screen's local variable

4. Click on Save - value should be there for some operation

Is this correct?

Check the attached OML if that works for you,


BlockEvent.oml

Hey Hung,

Does that meet your requirement ?

I checked on yours environment but it didn't work.

So i added an expression to stored local variable on view state.

Thanks!

Share the clear solution so any one stuck at same will get it from here.

Kind Regards,

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