I need to create a bot that can pull emails from a mailbox that contain a “pending” category and adding a column showing how many days the email has been pending. The trouble is that an email is not pending the day it’s received, it could be categorized a week after. So in essence when the bot runs once per day and a new row gets added as pending, if the next day the bot runs again and the email is still pending then the days pending column should be a 1.
It is because the current mail don’t have a valid date value, you can skip these mails by using simpe if condition to check if date value is null or empty
Put this in If condition & go ahead only if this value is true.
IsNothing(currentItem.DateAsDateTime)
You can also assing date value if you want to process such mails.