650
Views
10
Comments
Solved
Problem with Assigning Output parameter Of server action to client action
Question

My problem is pretty straight forward but also very annoying. For some reason that i just can't put my finger on - I'm unable to assign a local variable in a client action the value of a server action that is inside said client action. When debugging, the Server action is able to assign the values to the output parameter, but once leaving the server action screen to the client screen - it shows as if the value of the server action output is 0. I'm adding pictures to better visualize the problem.


In this picture - after fetching the data and assigning it to the output parameters, right before the end, the output parameters contain the correct values

when existing the server action back to the client action - the output parameters are 0!

thanks in advance, i feel completely stuck, any kind of help would be much appreciated.


2021-07-14 10-21-07
Krunal Vyas
Solution

Hello Komal,

Yes it will happen, @CincoMariposas Check this screenshot

I am also loosing the value.

But when i take a local variable with same structure type i get the value

Because i mapped the local variable with table widget

Hope this clears the scenario!


Thanks,

Krunal

UserImage.jpg
CincoMariposas
Solution

Hey Kurnal,

I will look this up, in the meantime I put all of the server action in a new client action, and this client action into the first client action - now everything works

2021-07-14 10-21-07
Krunal Vyas

Hello Cinco,

Following thread addresses a very similar issue like this:-

https://www.outsystems.com/forums/discussion/65217/loss-of-data-returned-by-server-action/

Please check it out, i hope it helps you!


Thanks,

Krunal

2021-06-01 05-56-33
Komal Kumbhar

Hi Cinco, 

Are you able to share your OML, 

I have same this way and get the out ,

Kind Regards,


UserImage.jpg
CincoMariposas

Hey Komal thanks for you help

Sadly sicne there is some personal data on the app, i'd rather not share the oml (removing said data would be a bit of a hassle)

still, here are all the pictures of all the parts of the action

2021-06-01 05-56-33
Komal Kumbhar

Are you using structure to return the data from server action?


UserImage.jpg
CincoMariposas

i tried both, once as a structer with an attribute of integer, and once as an output parameter type integer - both return empty

2021-06-01 05-56-33
Komal Kumbhar

I tired too with structure and it returns value,

i did not get one thing,

In above screenshot why current.position is there ??


2021-07-14 10-21-07
Krunal Vyas

Hello Cinco,

As it already gave you the link.

Platform does some internal optimization if the parameters you are returning not mapped to certain UI components or logics.

So they will loose the value.

Please check the thread.


Thanks,

Krunal

2021-06-01 05-56-33
Komal Kumbhar

Hi Krunal,

In Cinco's case, he has mapped the both output parameter to the local variable, still there is chance to loose the data??

2021-07-14 10-21-07
Krunal Vyas
Solution

Hello Komal,

Yes it will happen, @CincoMariposas Check this screenshot

I am also loosing the value.

But when i take a local variable with same structure type i get the value

Because i mapped the local variable with table widget

Hope this clears the scenario!


Thanks,

Krunal

UserImage.jpg
CincoMariposas
Solution

Hey Kurnal,

I will look this up, in the meantime I put all of the server action in a new client action, and this client action into the first client action - now everything works

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