web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Use item value in arra...
Power Automate
Unanswered

Use item value in array filter body in create file

(0) ShareShare
ReportReport
Posted on by 48

Hi,

 

I have a 5 values in the array, use them to generate pdf documents.  When saving the pdf file, I would like to name the file by adding the Owner/L'ld name as the prefix.

 

How can i reference the body.item.value for each iteration. The output should be 5 pdf files with the owner name value in the front.

 

filtery_arrary_item.png

 

 

Thanks

Jag

Categories:
I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Here is one solution for you. 

    Kaif_Siddique_1-1662211470404.png

     

    outputs('Compose')?[0]?['Name']

     

    Let me know if any query.

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.


    Regards
    Kaif

  • jsbev Profile Picture
    48 on at

    Hi Kaif,

     

    Thank you for the reply. I'm able to get the owner name value but the apply to each only picks up the owner name from the first row. We need to keep moving down each row, select the owner name and use that in the filename.

     

    I think this expression selects the first owner name in the array. How do we setup the expression to pick the owner name for each row?

    outputs('Compose')?[0]?['Owner name']

     

    first_owner_name.png

     

     

    filename.png

  • VictorIvanidze Profile Picture
    13,079 on at

    Use 

    item()?['OwnerName']

    in your Apply to each.

    See item() function.

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Update anyone:

    1. item()?['Owner name']
    2. items('Apply_to_each')?['Owner name']

     

    Kaif_Siddique_0-1662297723367.png

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.


    Regards
    Kaif

  • jsbev Profile Picture
    48 on at

    if i use items('Apply_to_each')?['Owner name'].pdf the flow works but if i add the unique identifier value in the file name box, the flow does not run complete. The flow outputs 4 files and then times out after 10 mins

     

     

    id_name.png

     

    The above peek code 

    "parameters": {
     "folderPath": "/Automation/ERPMA/output/Housing",
     "name": "@{items('Apply_to_each_2')?['Unique identifier']}_@{items('Apply_to_each_2')?['Owner name']}.pdf",
     "body": "@outputs('Generate_document_from_Word_template_2')?['body/fileContent']"
     }

    items('Apply_to_each')?['Unique identifier']_items('Apply_to_each')?['Owner name'].pdf

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    ID is Unique identifier ??(highlighted in blue)

    Kaif_Siddique_0-1662300816310.png

     

    If yes, I observed it has some special characters. Please check the ID used for naming the file:

    Kaif_Siddique_1-1662301322040.png

    Also, check length of File Name and Overall File Path should be as per Windows standards. 

     

    Regards

    Kaif

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 58

#2
David_MA Profile Picture

David_MA 53 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 36 Most Valuable Professional

Last 30 days Overall leaderboard