Xpath as Grid data source

0
Hi All,   I am trying to use something like below in my data grid with Xpath as data source. I need to check if a datetime attribute lies between a certain value. But below does not work at runtime. Could anyone please help [eventDate >= 'parseDateTimeUTC(formatDateTimeUTC($ImportSet/EventDate,yyyy-MM-dd),yyyy-MM-dd)'] [eventDate<'addDaysUTC(parseDateTimeUTC(formatDateTimeUTC($ImportSet/EventDate,yyyy-MM-dd),yyyy-MM-dd),1)' ]   Import Set is my input
asked
2 answers
1

Hi Shefali,

XPath data sources are great for when you want to show data over an association, or based on a static query. When you want to use an attribute of the context object as a filter for your nested datagrid/listview/etc, I think it's easier to source this grid by microflow. In your microflow, you will get an input parameter equal to the context object on the page, and then you may use that parameter to filter which records to show, and ultimately return a list of the objects to show in the grid.

p.s. it looks like there are some syntax issues in your xpath constraint--the single quotes around the right-side of your constraint makes the right-side a string, which means your constraint is trying to evaluate if `eventDate` is greater than "parseDateTimeUTC(...)" which isn't what you want. Try sourcing this grid from a microflow, using the context object as an input parameter.

answered
1

Hi Shefali,
Conor suggestion is a great idea on how to do this with a dataseource microflow. I would just like to add that you can not use the addDaysUTC function within your XPath constraints. Instead you should create a new dateTime variable, call the adDaysUTC function there and then use this new variable in your Xpath. Alternatively, you can try to rewrite your query to use the

month-from-dateTime

Xpath function, but this does not cover all use cases.

-Andrej

answered