I have some problems understanding / using the "PurgeAllPropertyHistory" of the Thing of which Iam trying to delete the logged data from.
The logged data are full numbers (1,2,3...)
What exactly is the startDate and the endDate? Does the "PurgeAllPropertyHistory" even care about which Date is being set here (It just has to be different I assume)?
Is it possible to delete ALL logged data without setting startDate and endDate?
I am trying to purge the data via a Mashup with a button that is connected to the "PurgeAllPropertyHistory" of my thing. I also tried to add startDate and endDate values per datePicker and the set it via Button
Hello @Nicolas_HORST ,
Value Stream is dependent on its Thing.
Running a purge on a Thing, will only clear out that Thing.
There are 3 different purges available on the Thing - PurgeAllPropertyHistory, PurgePropertyHistory and PurgeSelectedPropertyHistory.
With that being said, you need to give a start and end date or it won't purge/ delete your data.
When you call service PurgeAllPropertyHistory to remove all the data entries from a Thing using the Value Stream, make sure you also select the startDate and endDate, and also make sure the startDate is on the bottom and endDate is on the top.
Hope it helps,
Hello @Ciprian-Traian ,
Thank you for your reply.
I already tried every combination of start and end Dates that I can think of.. do I have to clear the Thing or the ValueStream? I think I tried clearing both but It seems like the data is still available (I am using a graph to see if its still there or not)
Would startDate be the date that is today and endDate is the date that I want to delete to or is it reversed?
Is there a way I can manually delete / see the data? Where exactly is it saved in the msql database?
Hi @Nicolas_HORST ,
Mention endDate as current time( var currentDate = new Date() ); Keep the start date as it is (undefined) .
Hello @Ashritha ,
Thank you for your answer.
How do I set the current date as that variable? I am using the DatePicker tool from Mashup menu.
And how do I run it?
I have linked a button to "PurgeAllPropertyHistory"
endDate is given by datepicker via ViewMashup (date Today)
startDate is empty (undefined)
Ive attached a picture of the bond between those things
I am connected to ThingWorx Industrial Connectivity 8 (TW Foundation)
Hi @Nicolas_HORST ,
Create a custom service
Hello @Ashritha ,
Thank you for you reply.
I created a new Service in the thing as seen as in the picture "2021-01-05_PTC-Community_PurgeAllPropertyHistory_3"
In picture "2021-01-05_PTC-Community_PurgeAllPropertyHistory_2" you can see that ive added the service to the thing inside the mashup view but i cant seem to connect those two..
Is there anything that Im missing?
There are 2 options for binding the service:
1) Drag and drop, but this can be tricky if you have several services in the mashup
2) Use the configure service button
a) Select currentTimeDate service from the Data pane in the mashup builder
b) Click the Data Properties tab below
c) In the upper right corner of that window, click the configure selected entity button (button with split arrow)
d) In the configure bindings windows on the left, locate the date field that is returned by your service
e) Click the drop-down arrow to the right of the field
f) Select Add Target
g) In the right window pane, click the Data tab at the top of the screen
h) Locate PurgeAllPropertyHistory
i) Expand the parameters section of the service if it isn't already expanded
j) Place a check next to the endDate parameter
k) Click Next
l) Click Done
If you still have issues, I recommend that we open a case. I will be happy to open one on your behalf if you desire.