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

Notifications

Announcements

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,073 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard