Announcements
Hello
I'm working on an email workflow in Dynamics so that, whenever an email enters system, it is checked for whether a specific attachment is included. i.e. it just checks the email attachments for an attachment with a given filename string, and then either performs an action on that record (or doesn't) accordingly.
Whilst I can make a view that will filter all emails with this attachment, I cannot find the same Attachments (Item) option in the dropdown in the workflow wizard.
Please may I have some advice on how to achieve this. I have lots of additional workflow solutions (like Jason Latimer's ones), and delete/add attachment by name having counted attachments before and after was one idea. But for whatever reason it never thinks the count has changed when I compared the before count to the after one.
Thank you
Hi,
Thank you.
I am happy to help you.
Thanks,
Pradeep.
Amazing! Thanks so much - it now runs successfully. You've been a fantastic help and it really is appreciated!
Hi,
I will try again.
Screenshot of your Power Automate:
Please add steps 2 as shown below:
Now,
In the next steps you use the Step2 File Name attribute. To check your specified condition For e.g.
Note:
In Power Automate We access any fields values of previous steps.
E.g. in If condition i can access the field from Step 1 and Step 2. Same applies for Other part of Power Automate.
Hope this helps.
hi - i am honestly so grateful for your help and very sorry that i'm not quite getting there
this was the full process that was failing
- i initially analyse the attachments
- then initialise the string variable containing the text i'm looking for
- then i check to see if the attachment name contains the string (but this is where it fails)
how exactly would i retrieve the record again?
when i do get record by id as follows, i cannot then reference this output in the check condition stage afterwards? it still only lets me reference the initialised variable I set containing the text string
thanks so so much again
Hi,
Yes. In If condition the fileName field is Null.
To Resolve that we need to retrieve same record again.
In previous screenshots which i was shared. There No.4 screenshots performs the same action.
There, i am retrieving same entity record to get FileName. because initially it was not present.
Thanks,
Pradeep
Thanks so so much Pradeep - I'm really appreciating your help
i'm trying to just check for the attachment name with the "check condition" stage, as per the below (but get the above error):
When I audit the attempted running of the process, and look at the raw outputs for the attachment record, I note that there is no output for the filename:
Could this be why the above issue is happening? i.e. because it cannot find the filename field for the attachment?
Thanks
Hi,
Sure. happy to help you.
Please find the screenshots:
1.
2.
3.
4.
Thanks,
Pradeep.
Please mark this as VERIFIED if it helps.
Thanks very much - I can now see where I should do this
Please could you show me the original screenshots with each step of the process opened out (rather than just being the bar with just the title)
Hi,
Sure.
Power Automate: In power automate we have lots of connectors which we can use in our development.
Here we do not need write the complex code C# etc. instead we have connectors.
Let us discuss about your scenario.
In your case you have WORKFLOW and in workflow based on business requirement we used to add the steps(i.e. Create, Update etc)
Same logic we can use in Power Automate as follows:
Lets say when Email record received IN CRM system then CRM create Email Records in Email Message entity.
Now if email contains the attachment then Attachment record will be created in Activity MIME Entity .
By using above logic I have developed above Power Automate.
As you know all data get stored in Dataverse hence we have used the Dataverse Connector in Power Automate.
Hope this helps.
Thanks,
Pradeep.
Please mark this as VERIFIED if it helps.
Hi Pradeep - thanks so much for this. I've not really used Power Automate before. Could you explain in a little bit more detail the process of "We can create Power Automate on Attachment(activitymimeattachment) Entity"
Thanks
André Arnaud de Cal...
294,017
Super User 2025 Season 1
Martin Dráb
232,852
Most Valuable Professional
nmaenpaa
101,158
Moderator