cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
note_taker_22
Level: Powered On

Initializing Object Variable - Mapping

Hello,

 

I'm trying to build a flow where whenever a new email comes in that has an attachment (.xlsx, .csv, .txt, etc.) and has a variable = "XYZ" to save the attachment(s) to a specific file folder, "XYZ_COMPANY". So far, the flow works for the first array (I hope I'm using the correct terminology) under "XYZ", but will not work for the second, "ABC". When an email with variable = "ABC" comes in with attachments, the flow will save the attachments to file folder "XYZ_COMPANY", when it should save the attachments to "ABC_COMPANY".

 

    Flow_1.PNG

 

 

{  


"foldermapping": [    


{      


      "FolderNameField": "XYZ_COMPANY",


      "sender": "XYZ"


    },    


{      


      "FolderNameField": "ABC_COMPANY",


      "sender": "ABC"


    } 


 ]


} 

 

 
Flow_2.PNG

 

variables('FolderName')['foldermapping'][0]['FolderNameField']

 

first(split(last(split(triggerBody()?['From'],'@')),'.com'))

 

 

 Flow_3.PNG

 

 

variables('FolderName')['foldermapping']

 

 

item()['sender']

 

 

 Flow_4.PNG

 

Flow_5.PNG

Folder path:

\\folder_path\ABC_COMPANY\

The Output under Folder path is generated from 'ComposeFolderName'

 

The Output under File name is generated from 'Compose-ConcatFullFileName'

 

This is my first post, so I hope I provided enough detail and explained the flow ok.

 

Many Thanks,

 

NT22

1 REPLY 1
Community Support Team
Community Support Team

Re: Initializing Object Variable - Mapping

Hi @note_taker_22,

 

Thank you for your sharing, I believe many peope would benifit from it.

 

Best regards,

Alice

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,801)