Hi,
I’m not sure what your exact use-case or clearing rule is, but I created a small sample that demonstrates how you can retrieve DatePicker widget IDs inside a list.
In the sample, the rule is simple: whenever a DatePicker is edited, the next DatePicker in the list is automatically cleared. For example, editing DatePicker 1 clears DatePicker 2.
To achieve this, I created a structure containing Name and Date. In the DatePicker’s extended properties, I assigned a CSS class based on the current item’s Name. Then, in the DatePicker’s OnSelected event, I added an input parameter containing the next date’s name. Using a small JavaScript snippet, I locate the next DatePicker widget in the DOM and clear its value.



Javascript I used:
- const inner = document.querySelector('.osui-datepicker.Date2');
- const widget = inner ? inner.closest('[data-block="Interaction.DatePicker"]') : null;
- $parameters.WidgetId = widget ? widget.id : "";
I attached a sample OML for reference.