37
Views
1
Comments
Solved
Web block to appear on specific condition in order

So basically i have a database and tasks entity with couple of attributes,one of them is CompletionDate which is a date type,On main page i want this weblock as shown in screenshot to only appear if there is a task and the completiondate on it is less then 24hours and only show the tasks that need to be completed in 24 hours,so for example if it has to be completed from 3 days from now i dont want that to appear in my webblock,how do i accomplish that? can i get some pointers or links to the  docs,i tried many ways but it didn't work.Thank you in advance.


Screenshot_2.png
2020-11-25 10-45-32
Mostafa Othman
Champion
Solution

Hi Giorgi,

You can place this web block inside a container and set its display property  equal to not List.Empty

where List is tasks returned from your database.

To retrieve tasks that should complete within 24 hours you can use aggregate which its source is tasks table and add filter 

Tasks.CompelitionDate >= AddHours(currdateTime(),-24) and Tasks.CompelitionDate < currdateTime()

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.