Skip to main content

Notifications

Power Automate - Building Flows
Answered

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

Posted on 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
    DaveMack 29 on at
    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
    DaveMack 29 on at
    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
    ManishSolanki 14,981 on at
    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
    abm abm 32,250 on at
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard