How to resolve this Error - Value of 1 dimensional array of string can not be converted into string

Value of 1 dimensional array of string cannot be converted into string
Why this error is coming ?

Please help me

@Ajinya_jorwekar

basically if you copy an paste the expression you will get that

try to type the expression manually

@Shiva_Nikhil I have type Manually but still it not resolved, please check & confirm whether I am doing any mistake ?

@Ajinya_jorwekar

try this once again

datetime.ParseExact(CurrentRow("Posting date").ToString,{"dd-MM-yyyy","dd/MM/yyyy","d-M-yyyy","dd-MM-yyyy hh:mm:ss"},system.Globalization.CultureInfo.InvariantCulture).ToString("ddMMyyyy")

No Sir, I had tried many times, It’s not working in my case, is there any alternative for this?

@Ajinya_jorwekar

can you try it by passing it in a assign activity

and pass that variable in the type into activity

Check the method signature: DateTime.ParseExact Method (System) | Microsoft Learn).

You are missing a parameter, hence the error. Can’t test it right now, but I believe this should work:

datetime.ParseExact(CurrentRow("Posting date").ToString,{"dd-MM-yyyy","dd/MM/yyyy","d-M-yyyy","dd-MM-yyyy hh:mm:ss"},system.Globalization.CultureInfo.InvariantCulture, Nothing).ToString("ddMMyyyy")

If it doesn’t work, you can try with DateTimeStyles.None instead of Nothing.

Yeh… It works for me, really Thanks @efelantti & @Shiva_Nikhil
You all are like hero for us.
Thanks for helping, Happy Automation :slightly_smiling_face:

1 Like

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