 So nice to see you guys again today. I'm going to give the next session in tracker data creation and upload. Um, so if we come back to this picture that we have already seen during this workshop. What we have done so far is to initialize the D2 so as the SDK, we did the login. So we are able to interact with the local database and the server. We sink the metadata we sink the data. And now we are going to focus in this other part, which is how to do the work, how to do the offline work and then how to how we do how do we upload the data. So our focus today is going to be tracker data and aggregate data will also be covered in workshop shoe. It's the same principle principles. You can refer to the docs but if you want to explore by yourself it's pretty similar but yeah today we are going to focus only in tracker data. Okay, so how do we add the data in our local database. The second point is the repositories. And once we use the repositories, the data is stored persistently in the database and mark does not sink. And then we have an upload method that you have we have to call explicitly to upload the data to the server. It's very important to understand that once we save some data, we're just saving that in the local database in the device but unless we specifically called upload we are not yet uploading it to the server. Okay, so I'm going to recap a little bit in the repositories. Since they are the entry point for great decoration and the vision of the data, and we have a different strategy for identifiable and not non identifiable objects. So we have two different types of repositories we have the collection repositories which are the repositories that we can access directly using the D2 and their structure in each model. So we have the object repositories. The first one the collection repositories represent the collection of objects. The second one represent a single object. These ones are different for identifiable objects, which are the ones that have a new ID. And for identifiable objects. And so the way to get them for identifiable objects is to use the UID methods in the collection repository. But for the ones that are not identifiable, the way to get them is to call the value, the value methods, and then pass the properties that make this value for this object unique. So this is the way to get the object repositories that we are going to need to edit the data. So first I'm going to explain how do we create data in identifiable object collections. And that's, we have an add method in the collection repository. So we have to first find the module and the collection repository using D2 from the collection that we want to where we want to add a new object to. And then we call the app method. And then we have to pass to this app method we pass the projection, which is an object which contains only the mandatory fields for this type. So we are not going to pass in all the fields that we can configure, or we can set in a track and track the instances for instance for example, we are only passing the mandatory object so it's really easy to create an object and then afterwards we can edit the once we call this app method and insert the projection, the object is stored in the database, and we get the UID. So with this UID we can continue editing and operating with this object. So here in a more detailed way we can see that this projection for tracking distances. The only thing that we are passing in the beginning is the organization unit and the tracking inside, and we will add more things like the attributes and more stuff afterwards. Okay, so we, once we have created this, this object, or if the object was really existing in the database, we can access their, their object repository and set or edit all their properties. And these that I'm showing now is the five different repositories that we have for tracker data. So, in the track entity module we have the track to the instances repository. You use the UID method to get the object repository. In the enrollment module we have the enrollments, sorry enrollment module enrollments repository. That's the nodes and finally the file resources. Okay, so once we have this object repository, how can we edit the property. We have different write methods in this repository for each property that we can, we can modify, we have a set whatever property. For example, set coordinates and we pass the coordinates or set dates, we set the dates so we have one for each different property that we have in the in this object. And then we have methods to delete or delete if exist, for example. And apart from the right methods that we can use to modify this properties, we also have some of the read methods if we want to check what it's, what do we have in the database. Okay, so I already explained how do we create and modify objects, which are identifiable. I'm going to explain now what happens with the ones that are not identifiable. So, for non identifiable objects we don't need to first create and then modify since it's solely a value, we can just put the value and it doesn't matter if it was already present or not. So what we do that is, we call in the repository, we call the value, we pass the attributes that identify this value, and then we can call the different methods that I'm going to present now. So we have different repositories or collections that we have for tracker data are to track entity attribute values and they track the data values. And what are the methods that we can that we can use. In this case we only have set value, so we don't have different properties we just have the value so we have a set value, where we pass the value as a string. And then we also have the delete or delete if exists. As in the indiviable we also have some read only methods like get or exists. Okay, so so far with this that we have done. We have updated the local database, but we haven't uploaded anything to the server. Like we said, we have to have in our minds that there are two different processes, editing the data and uploading it to the server. If we upload it, we have to call the upload method. In case of tracker data what we have as a method in the track entity instance repository. And if we don't specify anything. The SDK will upload to the server all the All the objects that are in state to post or to update it this is a state this state is something that is internal in the SDK to post are all the objects that are created locally. We don't have we haven't send them yet to the to the server and to updates means objects that are already in the server but we have some we have done some we have done some modifications. And if we do this, we are going to upload all this, all the files, sorry, all the all the objects. We can also restrict it. This is what we call granular sync. And we can use filters the same way that we just filters, for example, to get information from the repositories. We can use this filters to restrict the amount of data that we are uploading. So we've, for example, we say here, okay, attracting the distance by uid and we specify the uid and call the upload method. We're only going to upload this file and not the others. And we can also use any other filters we could say okay by name, and we just upload the tracking the distances by name or by any other property that you can that you can think of. Okay, so we are going to do one exercise. This is going to be a bit more complex that the ones that we have done so far. It will be guided by your instructor so I hope you will manage to solve it. I'm going to open the the skeleton up to show you what we are going to do. Just a second. All right. So we are going to use the code executor activity that you can find here in the lateral menu here on the bottom. You have got executor. And this is an activity that we have where we can run completely custom code. So basically we have a button here below. And we are going to implement something that is going to run when we click this button. And what we're going to implement is the creation of attract the distance. We're going to create the target in distance and probably to a program and add some attributes for it. Okay, so what we are going to do in the in the exercise is just a creation. It will be starting the database. So once we do it, if we're right, we should come here to the tracking distances page. And we should be able to see the day that we have created in the exercise. Since it's not uploaded yet, you will see that there will be an same method here. So we are going to click here after we have, we have finished it we are going to click on the same method, and we are going to go to the website and look for this look for this day. So we can verify that everything was created and synchronized up with the server. Okay. So more into the details of the of the exercise. We are going to create a track in the instance. We have some tips there that you can follow that we will also be in the in the code of the of the exercise. We are going to enroll you to a program. And we're going to set its program that entity instance attribute values. All right. So the brands that we are starting from is Academy online exercise for. I think it's actually exercise for data creation or something like that. Let me verify it. It's exercise for tracker data creation. And I think we can just go now to the breakout rooms and continue on our own with the facilitators.