Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How to add current date in JavaScript condition Expression

ramprakasht3196
Level 3
Level 3

Hi all,

I need to select data based on Last modified is today(current date) using Java script activity. So I used below script but Unable achieve the solution. Could you please help me here?

ramprakasht3196_0-1603458303513.png

 

 

Thanks in advance

6 Replies
Manoj_Kumar_
Community Advisor
Community Advisor

Hello @ramprakasht3196 

 

Use GetDate() instead of new Date();

 

Thanks,

Manoj

ramprakasht3196
Level 3
Level 3
I tried using both GetDate() and getCurrentDate(). It is not working inside QueryDef tag.
ramprakasht3196
Level 3
Level 3

I tried using both GetDate() and getCurrentDate(). It is not working inside QueryDef tag. Could you please help me here?

@amritakedia_epsilon & @Manoj_Kumar_ 

Manoj_Kumar_
Community Advisor
Community Advisor
Can you please confirm how you are using that GetDate() ? this is how it should be used <where> <condition expr="@expirationDate >= GetDate()"/> </where>
Sukrity_Wadhwa
Employee
Employee

Hi @ramprakasht3196,

Were you able to resolve this query with any of the given solutions? Do let us know.

Thanks!