72
Views
3
Comments
Solved
JavaScript does not return output parameter
Application Type
Mobile

I'm working on this mobile app where we have a usecase for encrypting/decrypting names on the client side. 

I want to implement this by using one JS node to encrypt with a base58 encoder on the client side when a user is offline. However, I cannot get my JS to work. As far as I can tell, the input parameter is being received correctly, but the output always returns "" and I cannot find out why.

For an example of what I'm trying to do, see below image or attached oml (LocalCase Screen).


(I am aware this does almost nothing in terms of security. I'm not at liberty to disclose the use case, but it makes sense in the big picture).

MedKid.oml
2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

As Ruben mentioned  decodeText() function is not being executed. I made a little change to your code and it seems to be working now.

you need to define the variables outside the function or you need to execute a function 

Check the attached sample bellow.

https://personal-ejuytnht.outsystemscloud.com/TestApp/SampleEncode

I hope this helps
Thanks
Tousif Khan

TestApp_Encode.oml
UserImage.jpg
Danique van der Hoek

Thank you! This has not only resolved my problem, but I also get why it did not work!

2023-02-03 11-00-49
Ruben Bernardo

First thing I would do is to indent the code.

After doing it, you'll notice that you are declaring a function named decodeText but you are never executing it. That's probably why the output parameter is empty.

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

As Ruben mentioned  decodeText() function is not being executed. I made a little change to your code and it seems to be working now.

you need to define the variables outside the function or you need to execute a function 

Check the attached sample bellow.

https://personal-ejuytnht.outsystemscloud.com/TestApp/SampleEncode

I hope this helps
Thanks
Tousif Khan

TestApp_Encode.oml
UserImage.jpg
Danique van der Hoek

Thank you! This has not only resolved my problem, but I also get why it did not work!

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