Date import from config file

Need some help on import data from Config file. While I am trying to import formula from config it is under double quotation or back Slash where formula is not executing. Example

Under config file
Date: now.adddays.today(-7) (“dd/mm/yyyy”)

Output in workflow is

“now.adddays.today(-7) (”\dd/mm/yyyy")"

Tried replace and remove but nothing work… any leads will be appreciated

Hi @Sucess_for_Everyone

You syntax is also wrong try this

Now.AddDays(-7).ToString("dd/MM/yyyy")


Can you try like below

Config("Date").ToString.Replace(Config("Date").ToString,Now.AddDays(-7).ToString("dd/MM/yyyy"))

Regards,

1 Like

Hi,

Do you want to run expression which is written in config file?
If so, basically it’s difficult.

For simple expression, the following post might help you.

Regards,

@Sucess_for_Everyone

Welcome to the community

Instead of full expression in the config…you can give the difference of days alone in config like -7 and then use that in the code to get the required date…so in config store on -7 and in the code use

Now.AddDays(Cint(in_Config("Daysvalue").Tosstring)).ToString("dd/MM/yyyy")

Cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.