I am building an app in reactive. The parameter that will be split named scan
Unfortunately the additional results are null
any idea to get the parts of the scan text variable?
you are not sharing the value from scan, that's crucial for us to help understand what's going on
The scan value is the 100,1994,677739
that should work, i meant, show it in your debug window, i can see both an input variable 'CodeScanned' into your action and a local variable 'scan' in your screen, are you sure scan has the intended value at the point where you do that StringSplit
Hi @George M ,
It should show split list as your logic seems correct.
If possible can you please share oml file so I can check what going wrong
Thanks
Arun
You may find it attached.
I checked your code, I would suggest use String_Split client action from Reactive Utility Component instead of using String_Split server action. It works fine and faster than string_split server action.
Please find component link below:
https://www.outsystems.com/forge/component-overview/1730/reactive-utilities#:~:text=A%20group%20of%20multiple%20utilities,side%20to%20the%20client%2Dside.
Thanks,
Arun Rajput
Try to output one of the variables on your screen. It should evaluate the real result then. Debugging server actions called from a client action can be weird, but the rule of thumb is that results from server actions called from a client action are only evaluated when they are used somewhere on the screen.
You are splitting a string with a server action, which causes an unnecessary roundtrip. Unfortunately, there is not built in one but you can create your own.
Create a new client action String_Split with two input parameters both of type text.
* TextToSplit
* Separator
Add an output variable List of type List of Text.
Inside add a Javascript widget
Note the input parameters TextToSplit and Separator
The Output parameter ResultArray has a type of text.
The code splits the text with the given separator. The resulting Javascript Array is then stringified and returned (this is needed as you cannot return a list of text from a javascript element).
After the Javascript widget add a DeserializeJson element
This on deserializes the stringified array to a List of Text.
Last assign the result of DeserializeListText to the client actions output parameter
The whole flow
You can add that function to a library for better reuse. Using clients actions in client actions are also easier to debug.
Best
Stefan
Hi @Stefan Weber,
May I know what is the datatype for "List" Output Parameter.
Kiruthika.
Just a List Text
Thanks Stefan. It really helps.
Hi George,I saw your OML but there were a lot of dependencies because of that I am not able to run your code.As per your screenshots, it looks correct, there might be some issue with your barcode scanner output.But anyhow I am attaching my OML for your reference. In a simple implementation, it is working fine, I tested with your provided value.Regards
Hi George,
Please check attached oml
Hope it will help you!
Regards