Is there anyway to pass a text list as an input parameter to another screen?
Hello Tenisha Lovell,Welcome to Outsystems Community,If I understand your question right , then you can use JSON Serialize & JSON to achieve thisSame question was asked before you can check the post from the links below - https://www.outsystems.com/forums/discussion/53751/structures-as-input-parameter-of-a-screen/
And this blog can also help - https://itnext.io/serializing-deserializing-json-in-the-outsystems-platform-ae08f2f6b5b4I hope this may help you.Thanks & regardTousif Khan
Thank you.
Though this works, be aware that there's a limit to the amount of data that can be passed. The parameters of a Screen are passed in the URL of the Screen, and there's a maximum of about 2048 bytes. See e.g. here for a discussion. So only use this if you can be certain the total size of the JSON is well below that limit.
Hi Tenisha,
As in Outsytems we cannot pass a list as input parameter for screen.
However, you can use String_Join to convert a text list to a string with a separator (such as special character like ";", or "," , etc...) then pass it as input parameter. After that OnInitialize you can use String_Split to convert back to list of text.
Hope this helps,
Khuong
This is pretty smart actually. I did a work around and created an entity to keep track of it and delete records when finished.
Two observations:
Input parameters of screen support only basic data type. It is not possible to pass a list. You can follow the above answers for alternatives. But It is not the best practice to pass large text from one screen to another because it is the cause of network latency.
Please share your use case and more details, why do you want to pass the list?
Best Regards,
Rahul Kumar
Hi @Rahul Kumar ,
I need one clarification ..i want to pass this payload to rest API..can you give me some ideas ..how can i pass this below format JSON file from the frontend... mainly that "qnaList" part format
{
"add": {
"name":"test1",
"qnaList": [
"id": 0,
"answer": "fine",
"source": "Custom Editorial",
"questions": [
"how are you?"
]
}
Hi Vigneswaran,
You are replying to an old(ish) topic that already has an answer marked as solution. This means your new post will get very little attention from the community. In these cases it's best to just start a new topic!
That said, in OutSystems, REST services send JSON based on the Structures that you define. This means your JSON must be converted to a Structure, and that Structure must be used in the REST method. Luckily for you, Service Studio can create a Structure based on JSON. To do so, go to the Data tab, and locate the Structure folder. Open the context menu by right-clicking and choose "Add Structure from JSON...". In the pop-up, paste your JSON, give the Structure a name and press the "Add Structure" button. You'll see a Structure is added, like this: