How to Filter Dictionary Keys

Hi, I have a dictionary(string, string) which has some keys with similar text.
example:
dictvar(“job date A”, “A”)
dictvar(“job date B”, “B”)
dictvar(“job date C”, “C”)
dictvar(“periode A”, “A”)
dictvar(“periode B”, “B”)
dictvar(“periode C”, “C”)

I want to iterate the dictionary using for each only for the keys that has “Job Date”
but using filter collection give me this error.
any solution?

Hi @ibnu.alem

For Each item In dictvar
If item.Key.Contains(“Job Date”) Then

End If
End For Each

Hope it helps!!

what you mean by End If End For Each?

@ibnu.alem

Remove the Filter collection activity.
For Each item In dictvar
If item.Key.Contains(“Job Date”)
Perform operations

Hope it helps!!

ah okay thanks, it works for my process purpose.

but is there no other way to actually filter it? just curious

WE can do with Linq

Yourdictvar.keys.where(function (x) x.contains(yourdate)).ToArray()

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.