Skip to main content
Community site session details

Community site session details

Session Id : eFlNpga5lwLAK2oWZmtBS0
Power Automate - Building Flows
Answered

Apply_to_each referenced by inputs in Compose action are not defined in the template

Like (0) ShareShare
ReportReport
Posted on 12 Feb 2024 12:11:29 by 29

Am creating a simple flow to populate an excel file with the details of people that have access to a PowerApp. I want their email address, their roleName and the createdOn date.

 

DaveMack_0-1707738808377.png

 

Above image shows the flow structure and it works fine for Email and roleName and the excel file is updated correctly, so the Compose and Compose 2 steps work okay.

However, because createdOn doesn't appear as an option in the Get App Role Assignments list, I tried using a dynamic expression for Compose 3:

 

 

items('Apply_to_each')?['properties/createdOn']

 

 

But saving throws this error:

 

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Compose_3' are not defined in the template.'.'.

 

This is a copy of the first record of the JSON for the array so you can see the items:

 

DaveMack_1-1707739211997.png

 

So createdOn is there within the properties part, but for some reason I can't access it like I can others. I can even get the scope and the notifyShareTargetOption, but not the createdOn or createdBy.


Am I missing something here? Anyone explain how I can extract the createdOn date ?

 

Thanks

 

 

 

 

  • Verified answer
    DaveMack Profile Picture
    29 on 12 Feb 2024 at 13:50:05
    Re: Apply_to_each referenced by inputs in Compose action are not defined in the template

    I'm an idiot !

     

    I overlooked the correct name of the Apply_to_each step. In my example it should have been:

     

    items('Apply_to_each_2')?['properties/createdOn'] 

    and not 

    items('Apply_to_each')?['properties/createdOn'] 

     

    Thanks for the help though 🙂

  • DaveMack Profile Picture
    29 on 12 Feb 2024 at 12:45:45
    Re: Apply_to_each referenced by inputs in Compose action are not defined in the template

    Thanks but have tried below and get same error message

    items('Apply_to_each')?['properties']?['createdOn']

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 12 Feb 2024 at 12:25:23
    Re: Apply_to_each referenced by inputs in Compose action are not defined in the template

    Hi @DaveMack 

     

    Pls try this:

    items('Apply_to_each')?['properties']?['createdOn']

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 12 Feb 2024 at 12:23:36
    Re: Apply_to_each referenced by inputs in Compose action are not defined in the template

    Hi @DaveMack 

     

    Correction, Ofcourse it is within the properties so like @ManishSolanki  mentioned use that. I clearly didn't looked into it. 😂

     

    items('Apply_to_each')?[properties]?['createdOn']

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Loading complete