Azure Logic App - GetEntities (Azure Table) connector filter returning wrong result

Viewed 369

In my logic app one step takes some filtered entities from Azure Table Storage. Filter consist of two conditions:

  1. One field has to be equal to some constant value
  2. Other field (datetime) has be to less or equal than current time minus 10min

It worked ok until last month when it started to return wrong results as seen in the screen below: enter image description here

And the connector in Edit Mode:

enter image description here

I cannot work out what is happening. If I edit the row in the Azure Table (just click Update without changing anything) it starts to work properly. I thought that maybe the field was set with wrong type, but everything seems ok:

enter image description here

1 Answers

Maybe your error is caused by the wrong type of CreatedDate, you can refer to this post.

Simply put, you insert a time-formatted String into Azure Table data formatted as DateTime. This is shown in the portal as type DateTime, but it is actually a String.

Solution:

1. If you want to insert data of type DateTime, you can specify odata.type, please refer to the following example:

{  
   "Address":"Mountain View",  
   "Age":23,  
   "AmountDue":200.23,  
   "CustomerCode@odata.type":"Edm.Guid",  
   "CustomerCode":"c9da6455-213d-42c9-9a79-3e9149a57833",  
   "CustomerSince@odata.type":"Edm.DateTime",  
   "CustomerSince":"2008-07-10T00:00:00",  
   "IsActive":true,  
   "NumberOfOrders@odata.type":"Edm.Int64",  
   "NumberOfOrders":"255",  
   "PartitionKey":"mypartitionkey",  
   "RowKey":"myrowkey"  
}  

Reference:

https://docs.microsoft.com/en-us/rest/api/storageservices/understanding-the-table-service-data-model#property-types

https://docs.microsoft.com/en-us/rest/api/storageservices/inserting-and-updating-entities

2. Define CreatedDate as String type, but this is not a very good solution, it is better to insert the correct DateTime data.

Related