コレクションの各要素の繰り返しでフォルダ内のitemに比較対象の変数1と変数2の値が含まれていたら等しいという条件文を作りたいです。ご教示ください。Contain関数とequalの組み合わせ技だとかんがえています
こんにちは
具体例を共有できますでしょうか?
item文字列中にそれぞれが含まれているという意味でしょうか?
おっしゃる通りです。
入力データテーブルのrow().tostring の値が
Item文中にふくまれていたらと言った感じです
Hi @natsumikan
Try this:
Assign variable1 = "some_value"
Assign variable2 = "another_value"
Assign folderItems = Directory.GetFiles("path_to_folder")
For Each item in folderItems
If item.ToString.Contains(variable1) And item.ToString.Contains(variable2)
// Perform the action to repeat each element here
End If
End For Each
Regards
こんにちは
上記のrowは何でしょうか?ForEachRowで指定した変数でしょうか?
またitemはForEachで指定した変数でしょうか?
以下であっていますか?
具体的にどの変数にどのような文字列が含まれていて、どのような時にTrueにしたいかを共有いただくと齟齬が無いかと思います。
Hi @natsumikan
=> Take two assign activities to store the data for Variable1 and Variable2.
- Assign → Variable1 = “Data to store in Variable1”
- Assign → Variable2 = “Data to store in Variable2”
=> Use for each file in folder activity to iterate the files in the required folder. Output - CurrentFile
=> Inside for each file in folder activity insert the If condition to check the condition which met the Variable1 and Variable2
- Condition → CurrentFile.Name.Contains(Variable1) and CurrentFile.Name.Contains(Variable2)
=> In then block you can give the activities to move forward If the condition is true.
=> In else block you can give the activities to move forward if the condition is false.
Check the below workflow for better understanding.
Hope it helps!!
両者ともご認識の通りです。上記で解決致しました。ありがとうございます。
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.