I have a send email action and want it to check an array (attachments to the email) for a specific word (in filename), and if that exists, add an email to CC.
I'm not sure how to write it, concat was the closest thing to a "add text"-function I could find.
Any ideas on how to get it to work? Ideally directly in the CC-field with extra variables and Compose-actions.
I think you're on the right track. Just need to change the syntax a little.
if(contains(string(variables('attachmentArray')), 'BrandlarmVCCAtt'), 'name@test.com', '')
The if expression takes three arguments. In this situation, the first argument is the conditional presence of a substring inside a string is the condition. The second argument is what to return if the condition is true (an email string). The third argument is what to return if the condition is false (an empty string). Source: Reference guide for expression functions - Azure Logic Apps | Microsoft Docs
The contains expression takes two arguments. In this situation, the first argument is the string you want to search within, and the second argument is the substring you're search for. Source: Reference guide for expression functions - Azure Logic Apps | Microsoft Docs
I don't think you need to use the concat expression since the if expression is placed inline after a string.
Hmm.. But the syntax for contains is:
contains('<collection>', '<value>')
And the name of the collection/array is 'BrandlarmVCCAtt' and the string to search for is 'SATS', so shouldn't it then be like:
if(contains('BrandlarmVCCAtt', 'SATS'), 'nicki.vike@sats.se', '')
Thanks for that clarification... If "BrandlarmVCCAtt" is the name of a variable in your flow, then the syntax would be:
if(contains(variables('BrandlarmVCCAtt'), 'SATS'), 'nicki.vike@sats.se', '')
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
68 | |
23 | |
17 | |
16 | |
13 |
User | Count |
---|---|
118 | |
35 | |
33 | |
28 | |
26 |