386
Views
3
Comments
Solved
Setting the default value for date local variable
Question
Application Type
Reactive

Hi all,

Can we able to set the default value for date local variable as current date + 3 weeks ?

I know we can use this function AddDays(CurrDate(),21) and assign the duedate in client action.

But how can I assign in default value ?

UserImage.jpg
Kay Lun
Solution

Hi Sowndhar,

Default value should be a literal, no expressions allowed.

So the best way to do is to do the AddDays() in OnInitialize event, and assign the result to the local variable.

Hope this help.

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello
You can add a default value for the variable type, 
we cannot add a formula to calculate here
You can do that calculation on initialize action or you need to add assign on any of the flow where it is.
https://success.outsystems.com/documentation/outsystems_developer_cloud/building_apps/data_in_outsystems_apps/data_types_and_conversions/

Thanks

UserImage.jpg
Kay Lun
Solution

Hi Sowndhar,

Default value should be a literal, no expressions allowed.

So the best way to do is to do the AddDays() in OnInitialize event, and assign the result to the local variable.

Hope this help.

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello
You can add a default value for the variable type, 
we cannot add a formula to calculate here
You can do that calculation on initialize action or you need to add assign on any of the flow where it is.
https://success.outsystems.com/documentation/outsystems_developer_cloud/building_apps/data_in_outsystems_apps/data_types_and_conversions/

Thanks

UserImage.jpg
Sowndhar S

Thanks @Kay Lun and @Tousif Khan . Now I am able to assign the value in duedate.

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