こんにちは。
Excelシートを1行目から順番に処理していくWFの冒頭で、“key”,"value"の値を記入した設定.xlsxを外部ファイルとしてDictionary変数に読み込んでいますが、過去のプロジェクト経験ではDictionary変数の型をDictionary(String,Object)にしたケースと、Dictionary(String,String)にしたケースがあったため、どちらが良いか、分からずにいます。一見前者のObject型の方が汎用性が高そうに見えますが、String型からでも他の型に変換できるため、結局大差ない気もします。UiPath開発経験豊富で知見のある方、コメントをお願いたします。
こんにちは
入力がエクセルに限られるのであれば、Dictionaryの値はstringでもobjectでもそれほど差はないと思います。
入力ソースが他にあり、StringにCastするには複雑な型がセットされる可能性があるのであればObjectとする意味があるかもしれません。
If you use object then implicit conversion to string always is not need
For example if you give a key for count and value is 1…when you assign the key value in object case it would be dict(currentrow("Key")) = currentrow("Value")
this value column can be anything
- In case of string it is important to convert it to string for saving else it would throw an error
dict(currentrow("Key")) = currentrow("Value").ToString
This applies for dates etc as well…using object is preferred because it retains the original form of the value
Cheers