I want to add value/point to a object based on date of creation entity.
Hi all, First time using the forum as a student. My Question: I want to add points/value to (probably using a atribute) to an object or atribute. I need to have my atribute of my entity to have more points based upon the date of creation of this entity when a end user has created it. So the older this entity is, the more points it will have. This is because my app wants to priotizise older entities first because the app’s purpose is to sort complaints (entities) into importance of date of creation. Of course the older complaints will have higher priority because those users have been waiting longer. To do this i use my microflow and add points to a object/atribute, lets say 1 point per day. In the end, the administrator can see wich complaint has higher priority (based on the points) to be tackled. So far i have first used the complaint entity as a parameter, then retrieved the datetime atribute i created in the entity and then i’m lost as i think i have to create a object and make an expression with it. That’s all i know so far. Anybody can help me with it? Also if there is a specific link on mendix with the right expressions that tackles this, please do link it.
Why are you adding points to the oldest complaint?
If you want to sort the complaints on the base of oldest to newest can't you just use the list operation activity to
sort the list on the base of oldest to newest ( on the basis of created date)?
This is a workaround, but it will work.
Hope it helps!!
I agree with Rishabh's comment. You can use the createdDate system member of an entity to store when it was created originally, and use that date in a data grid to sort the list of all complaints.
If you check the Store ‘createdDate’ checkbox on the right side of the Entity Properties dialog, it becomes available for use in microflows, pages, etc.
If you still want to want to use a point-based system, you could to use a microflow to retrieve all complaints, loop over them and assign a value to an attribute in the Complaint entity based on the createdDate of that entity. Do keep in mind though, that this is a pretty resource intensive operation, as you need to go over all complaints and update every single one of them, every single day. I would not recommend to do it like this and instead just use the createdDate to sort the compaints.