Graphing data

  

I am working on my first solo app, after working through the mobile apps training course. So I am getting into trouble!

I have a list of solar collection data, one number per day, that I want to graph against time. I imported historical data and this shows in the right time order on a line graph. If I enter more data locally through a form, it is shown on the graph but seems to overwrite existing data [using createorupdatelocal...data]. For example, if I enter a datum point for the date May 19, 2017, it seems to overwrite Jan 1, 2017. The graph then connects May 19 to Jan 2, on the graph, as shown below.

Beginner question: Do I need to add a value for the id field or is this done for me? it seems like the id field is being re-used, when I enter data manually.



Data Entry Date 05/19/2017 Energy 32.1 Save


Further, data is not synched to server data, which I am showing on another page. I am calling triggerofflinedatasync for this.

Thanks for any guidance...

Any chance of some help with this, please?

Hi Lee,

Regarding the entity identifier, if the entity has the property "Auto Number = Yes, if empty" then an id will be generated if the record has a null identifier in that attribute. From the description of your problem it looks like you are using the .Current of the aggregate you are using for the graph to add new records to that entity. You're probably not setting the Id attribute to NullIdentifier() which makes it replace the first entry in your data. You should instead create a local variable and work with it to create new records, instead of re-using the .Current in the aggregate.

Regarding the data synchronization, have you implemented the OfflineDataSync client action and the ServerDataSync server action? You can find more info about synchronization here: https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Offline/Offline_Data_Synchronization_Patterns

Hi Carlos

Many thanks for the suggestions. You are correct: I was using the .Current set of data from the aggregate. Although I did have a null value for the Id field, I had not fully understood where to assigns value for new data. I have this working now for new data and updates.

Thanks again. Feels like a major step forward in my understanding!

Lee