I am using FUEL sdk to create Data Extensions. I want to set the default value of a column which is a DATE data type to Current Date.

ET_DataExtensionColumn de_col_insertdate = new ET_DataExtensionColumn { Name = "InsertDate", DefaultValue = Convert.ToString(DateTime.Today), FieldType = DataExtensionFieldType.Date, IsRequired = true };

This is not creating the data extension as the field type is DATE.

If I am not using Convert.ToString, I am getting an error - Cannot implicitly convert type 'System.DateTime' to 'string' as DefaultValue is String type.

If I pass the DefaultValue as "04/06/2018" and remove the FieldType = DataExtensionFieldType.Date, it's creating the data extension but its no longer DATE datatype.

Please let me know if anyone was able to successfully set the default value of a DATE datatype field to current date using fuel sdk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.