alonica
(alonica)
January 17, 2024, 5:43am
1
繰り返し(コレクションの各要素)で項目のリストとしてはDictionary型変数を使用したいのですが、プロパティのAgumentTypeを「“System.Collections.Generic.Dictionary<System.String,System.String>」を指定し、Bodyの中で「CurrentItem(”key”)」でvalueを取り出そうと実行すると下記のエラーが出力されます。
Unable to cast object of type ‘System.Collections.Generic.KeyValuePair2[System.String,System.String]' to type 'System.Collections.Generic.Dictionary2[System.String,System.String]’.
そこでAgumentTypeを「System.Collections.Generic.KeyValuePair<System.String,System.String>」に変更すると「CurrentItem(“key”)」で値を取り出している箇所が下記エラーとなります。
構造体’String, String)'には既定のプロパティがないため、インデックス処理を実行できません。
繰り返し(コレクションの各要素)でDictonary型変数のvalueの値を取得にはどのように設定をすればよいでしょうか?
Hi @alonica
I think you want to access all the values of dictionary variable.If yes,
Need to give currentitem.value as below
You can also able to access the keys of the dictionary variable by using currentitem.key
If you want to access the value of a paticular key.You can directly give dict1("key")No need to use for each. example as follows
Hope it helps!!
alonica
(alonica)
January 17, 2024, 6:06am
3
The first one is the answer what I wanted!
Thank you so much!!!
1 Like
mkankatala
(Mahesh Kankatala)
January 17, 2024, 6:06am
4
Hi @alonica
Check out the below workflow:
Sequence9.xaml (9.4 KB)
In the For Each loop try changing the datatype to KeyValuePair(System.String,System.String)
Hope it helps!!
Regards
1 Like
alonica
(alonica)
January 17, 2024, 6:29am
5
Perfect answer! Thank you so much!!
1 Like
system
(system)
Closed
January 20, 2024, 6:30am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.