Greetings.
I have data that save in database like this:
This is what the requirement want in how do we save the data. But when we want to display the data, they want it to be like this:
i tried using newLine(), but i am not sure on how to find the character, then newLine.
Also how to get the total of the amount?
Hello Asya,
I hope you´re doing well.
Regarding your issue, it's solved!
What do you need to do in steps:
1. Create a fetch data action and call the server action:
2. Implement the server action logic flow:
3. Show the results in the UI:
I send you the OML file attached where you can see the code.
Let me know if you have any doubts or questions.
Kind regards,
FC
Nevermind, found the mistake.
Hi FC,
I tried your way, but I have a bit problem here
it shows this error. What does it mean?
ps: I can't share the oml because of data privacy
Regards,
Asya
i tried your way. when I clicked save, the data is saved in database. but the table display 0, instead of my data
Hi Asya,
Did you see my OML file with the logic flow implemented?
Don't have errors, it's working and do what you want to do.
Where are you doing that action, on a server action/client action or in the data fetch action?
Maybe these errors are related to the lists that you are iterating and/or the for each cycle path and/or the place you are creating the action.
What I did:
I iterated the NameList (local variable) and the AmountList (local variable) and append the first element of each list to the ExpensesList (output variable).
Let me know your thoughts and if it worked for you.
If you can share a dummy OML file with that error is better for me to help you.
Sorry, i found my mistake and it worked now. Sorry for the late marking your answer as solutions. Thanks a lot Fabio
Nice!!!
I'm glad that I could help you.
Let me know if you have more issues or questions regarding OutSystems.
Have fun with OutSystems :)
Hi Asya
The NewLine() gonna add a "enter" in the string, so if you have "Breafast;lunch;Dinner;" you gonna get "Breafast;lunch;Dinner;
"
You tried use the String_Split action from the extension Text?
You can see how to manipulate texts where https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/Text_API
Maybe it can help you.
I think was think where, and this maybe be work for you, I can't do the test.
So you get the data from Expenses, and after do a For each and Split the name and Amount, and after insert the values in a new list, after all you return the new list and show in a table.
But the best way is to save the data the way you need to show, so you don't need to do a split or things like that.
Regards,Luiz Bubiak