Hi, is there anyway (or sth similar) to dynamically create different collections inside a loop. If I want to loop through these keywords then I want to add it to a corresponding collection instead of having every output of the keywords in one single collection.
Keyword1 to a collection named “listpage(Keyword1)” for example
So I can reference the collection dynamically when I add the data row to a table as well
Thank you for your reply. I was only able to add one picture. If I loop through the three keywords, “Keyword 1”, “Keyword 2”, “Keyword 3”, what ended up happening is that it adds all the instances that keywords appeared in the PDF pages into “a single collection”
I want it to add to separate collections. Keyword 1 to collection 1 Keyword 2 to collection 2 and so on
so when I reference the collection during the “Add data row activity” it will output sth like
File Name | Keyword 1 | in which page the keyword appears in (Ex: 3, 5)
File Name | Keyword 2 | in which page the keyword appears in (Ex: 1,2)
File Name | Keyword 3 | in which page the keyword appears in (Ex: 10)
the problem I currently face is that it adds all the pages together since I only have one collection (listPage) so my current output look sth like this. If I have separate collections then, when I add the data row it should be independent instead of combining all instances where the different keywords appear together
File Name | Keyword 1 | Appears in 1,2,3,5,10
File Name | Keyword 2 | Appears in 1,2,3,5,10
File Name | Keyword 3 | Appears in 1,2,3,5,10
with the second explanation, we can recommend focusing more on the use case and defining it more sharply without mismatching with implementation constraints. This will avoid an XY-Problem creation.
Once the the overall goal is cleared we can check for strategies and appropriate datatype/structures.
So, dictionaries, JSON, DataTable can help.Also it is possible to create intermediate results and transform it into final results. Depending on the loops maybe some info are not needed to get stored within an intermediate result (e.g. filename).
with a variation of Paul’s suggestion in a flow like
Assign Activity:
myDict = KeyWordList.ToDictionary(Function (x) x, Function (x) new List(Of int32))
For each Activity | kw in KeyWordList
If Activity | Condition: result.toLower…Contains(kw.toLower…)