Get outlook graph activities issues

hi
i am using graph api get outlook activities to read the mails and the ouput variable is Mails its argument type is microsoft365

mail.Subject.ToString.Contains(SearchKey) and mail.From.ToString.Contains(“sai@.com”)
I previously used a list of mail messages as the argument type, but I am now updating to use the Microsoft Graph API. After reading the emails, I need to loop through them using a For Each activity, and I’ve updated the argument type accordingly. However, I’m having trouble with the condition not being accepted by the new Graph API. Could you please help me update the entire process to work with Microsoft Graph?

Can you check the type argument of the For Each activity, and the type of your mails variable? It seems like there could some misconfiguration since the error mentions System.Array.