How do you check if workbook datetime parameter is not set?

%3CLINGO-SUB%20id%3D%22lingo-sub-1869155%22%20slang%3D%22en-US%22%3EHow%20do%20you%20check%20if%20workbook%20datetime%20parameter%20is%20not%20set%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1869155%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20setup%20datetime%20picker%20so%20I%20can%20filter%20results%20of%20Resource%20Graph%20query%20for%20tags%20values%20in%20specific%20daterange.%20I%20want%20to%20show%20all%20results%20when%20parameter%20is%20not%20selected%20at%20all%20(%22unset%22)%3C%2FP%3E%3CP%3EI%20expected%20that%20I%20can%20use%20following%20KQL%20expression%20but%20it's%20not%20working%20since%20I%20assume%20parameter%20value%20is%20not%20empty.%20It%20fails%20with%20error%20message%20below.%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3EQuery%20is%20invalid.%20Please%20refer%20to%20the%20documentation%20for%20the%20Azure%20Resource%20Graph%20service%20and%20fix%20the%20error%20before%20retrying.%20todatetime()%3A%20function%20expects%201%20argument(s).%20Filter%20expression%20should%20be%20Boolean...%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-sql%22%3E%3CCODE%3E%20Resources%0A%7C%20where%20type%20%3D%3D%20'microsoft.compute%2Fvirtualmachines'%0A%7C%20where%20tags%5B'datecreated'%5D%20%26gt%3B%20%20coalesce(todatetime(%7BdateCreated%3Astart%7D)%2Ctodatetime('2016-11-09T02%3A53%3A17.4582226Z')%20)%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Contributor

Hello,

 

I have setup datetime picker so I can filter results of Resource Graph query for tags values in specific daterange. I want to show all results when parameter is not selected at all ("unset")

I expected that I can use following KQL expression but it's not working since I assume parameter value is not empty. It fails with error message below.

Query is invalid. Please refer to the documentation for the Azure Resource Graph service and fix the error before retrying. todatetime(): function expects 1 argument(s). Filter expression should be Boolean...

 

 Resources
| where type == 'microsoft.compute/virtualmachines'
| where tags['datecreated'] >  coalesce(todatetime({dateCreated:start}),todatetime('2016-11-09T02:53:17.4582226Z') )​
0 Replies