Hi @Earth_2
Based on the error message you gave, this is a type conversion issue.
The first thing you can use is to check if the object is compatible with a given type, and if it is compatible, it returns true, otherwise it returns false and no exception is thrown. Before type conversion, you can use is to determine whether the object is compatible with a given type, and if so, then convert. For example:
string str="test";
object obj=str;
if(obj is string){string str2=(string)obj};
Secondly, we can use as: for conversion between reference types, direct conversion, if the conversion is successful, it will return the converted object, if the conversion fails, return null, and do not throw an exception. For example:
string str="test";
object obj=str;
string str2=obj as string;
if(str2!=null){return "success"}
If you can share a little bit of the other code, I think I can pinpoint the problem more precisely.
Best Regards
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.