56
Views
7
Comments
Solved
How to separate data when have certain character?
Application Type
Reactive
Service Studio Version
11.53.17 (Build 61327)

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?

testing2.oml
2022-10-11 21-19-04
Fábio Miguel Ferreira Coelho
Solution

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

testing2.oml
UserImage.jpg
Nur Asy Syakirin Zubir

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

UserImage.jpg
Nur Asy Syakirin Zubir

i tried your way. when I clicked save, the data is saved in database. but the table display 0, instead of my data


2022-10-11 21-19-04
Fábio Miguel Ferreira Coelho

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.


Kind regards,

FC

UserImage.jpg
Nur Asy Syakirin Zubir

Sorry, i found my mistake and it worked now. Sorry for the late marking your answer as solutions. Thanks a lot Fabio

2022-10-11 21-19-04
Fábio Miguel Ferreira Coelho

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 :)

2019-03-28 12-46-56
Luiz Bubiak

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

testing2.oml
2022-10-11 21-19-04
Fábio Miguel Ferreira Coelho
Solution

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

testing2.oml
UserImage.jpg
Nur Asy Syakirin Zubir

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

UserImage.jpg
Nur Asy Syakirin Zubir

i tried your way. when I clicked save, the data is saved in database. but the table display 0, instead of my data


2022-10-11 21-19-04
Fábio Miguel Ferreira Coelho

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.


Kind regards,

FC

UserImage.jpg
Nur Asy Syakirin Zubir

Sorry, i found my mistake and it worked now. Sorry for the late marking your answer as solutions. Thanks a lot Fabio

2022-10-11 21-19-04
Fábio Miguel Ferreira Coelho

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 :)

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