38
Views
10
Comments
Solved
Unable to assign output parameter of javascript action to local screen variable O11

I am currently unable to assign my output parameters to local variables.

i am implementing a position picker on hand of on overlay container on a image. 
yet while the console.log($parameters) does return a accurate result. its when i assign this to a decimal value nothing happens.

Assigning the output to local variables.

Console result output parameters.



Outsystems notification showing X and Y using expression after onClick: (console output on the right)
ps: i am aware that im currently calculating everything onclick. just want to get it in a working state first

Champion
Solution

Hello Jan Wilfried van der Plaats,

The issue is not with data type. the issue is you are setting the output parameters in event listener.

Check this example

Try this one

On pin change action

Widget tree


Exactly that i mention.

Looking at the  demo app you've made it behaves exactly as i intended it to!

i'll be working on your implementation today and will mark this question as solved if im done :)



thanks for the demo app and information. really appreciated :)

Champion

Hi

Issue is because in decimal can hold the value up to 8 digits only after decimal and in above case there are more than 8 digits. Try to assign the values in other data types may be a text type output parameter, with datatype conversion if required.

i have already tried this to no avail. converting the output with .toString and assigning it to a text variable.

Champion

You need to change the datatype of output parameters, from above screenshot X & Y should be of text type. Then assign the values of valueX and valueY respectively without any conversion.


regards


Changes have been made. also changed local variables data types. no changes in results.
Now result is an empty string being sent in feedback message: 


Console output remains the same for: 

console.log($parameters.valueX, $parameters.ValueY)






js:

Vikas,

You are giving bad advice, twice. Please don't write things you do not know anything about.

hi,

You can create a New ScreenAction with 2 Input Parameters for valueX and ValueY and do the Assignment of valueX and ValueY to Screen Local variables X and Y inside this new ScreenAction.

and Just Call this New ScreenAction inside Image Click event definition and pass values of X and Y.

Champion
Solution

Hello Jan Wilfried van der Plaats,

The issue is not with data type. the issue is you are setting the output parameters in event listener.

Check this example

Try this one

On pin change action

Widget tree


Exactly that i mention.

Looking at the  demo app you've made it behaves exactly as i intended it to!

i'll be working on your implementation today and will mark this question as solved if im done :)



thanks for the demo app and information. really appreciated :)

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