Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

expression lookup field for approval flow

(0) ShareShare
ReportReport
Posted on by 41

i have 2 list, Document list and Department list, i have a column “Department“ in document list type of look up

 

In the "Id" field of the "Get item" action of Document list, what is expression  or dynamic content that represents the selected department lookup value from the trigger or previous action in order to  retrieve the selected department from the Document list to send approval email to Responsabile of the departement?!

this flow is pissed me off. 😓

thank you 

  • Sam2089 Profile Picture
    Sam2089 41 on at
    Re: expression lookup field for approval flow

    @AWorley please check your msg inbox, i sent a message to you. thanks

  • AWorley Profile Picture
    AWorley 414 on at
    Re: expression lookup field for approval flow

    I use the Set Variable action in the Apply to Each2 Action. Initialize variable is a separate action at the top of the flow. Other than that the flow is as shown in the screenshot. 

  • Sam2089 Profile Picture
    Sam2089 41 on at
    Re: expression lookup field for approval flow

    @AWorley 

      what are you saying? or i can not understand your spoken english

    or you dont know what are you saying. im so sorry. 

    in screen hot you intilize variable in the apply to each 2 and the n in the next message you said You then set a “set variable” in the Apple to each 2 ??!!! 

     

    would you please to tell me the order of all trigger and action?

    1-When an item is created

    2-get items no?

    3- then?

     

     

    i have 2 list, Document list and Department list, i have a column “Department“ in document list type of look up, and in the department list i have Responsabile column it refere to person means any department has a responsibile to approve the file, how can i create a flow in the first level and send approval email to who is responsible of the department, i mean assigned to dynamiclly who is responsibile that has been selected for that file
  • AWorley Profile Picture
    AWorley 414 on at
    Re: expression lookup field for approval flow

    initialize variable can only be placed on a top level (for some reason). The only action above the screenshot not shown is the sharepoint trigger and the initlize variabke.

    You then set a “set variable” in the Apple to each 2.

     

     

    as for approvals I would do a condition statement in the apply to each action that states when an item returns true to send for approval. However you may get spammed with approvals so you may just want to just add the true resulting items to a MS List. Then do a second flow for “when an item is created” to send approval with the information of that item. 

  • Sam2089 Profile Picture
    Sam2089 41 on at
    Re: expression lookup field for approval flow

    @AWorley 

    it give me error 

    The operation 'Initialize variable' can only be used at top level. 😒
    so why?
     
    so what part of the flow i must put Start and wait for an approval?! 
    in assigned to field what is expression dynamic?
    this action so important for my flow. 
     
     
    Schermata da 2023-06-05 09-58-44.png

     
  • Sam2089 Profile Picture
    Sam2089 41 on at
    Re: expression lookup field for approval flow

     @AWorley  thank you so much,i think have token best reply from you so far, your reply is correct i think. 

    but the first part of your message is not clear for me, i need to know step by step

    first of all -----> 

    When an item is created

    after that i need to put Get items action right

    in your screenìshot apply each 2 which part of flow is? after get items? 

     

     

     

    @AWorley

  • AWorley Profile Picture
    AWorley 414 on at
    Re: expression lookup field for approval flow

    You can just put the ID Dynamic content field from the Department list. The best way to discern from each list is to rename the action to something like "Get Items - Department". Essentially the format for renaming should be "Action Name - General name". You also don't really need to add the ID to a compose. Doing TriggerOutput()?[body/department/ID] would be sufficient. 

     

    Now the ID Field in a list is the unique numerical value created in order of each new Item. If you need to send the department the email you're better off doing a Apply to each item > condition statement for if "Current Item" is equal to "Department name value" get  email for the department.

     

    In the below example I used the Author field in my list to compare. Just replace the "Author" with your Department Name column in the Department List and then in the Document List is just the "When an Item is created" value for your "Department" column. 

     

     

    AWorley_1-1685629787810.png

     

     

     

     

     

  • Sam2089 Profile Picture
    Sam2089 41 on at
    Re: expression lookup field for approval flow

    @ManishSolanki 

    are you really joking? after "when an item created trigger" you add a compose and so then? what will happend?

    any get items action or any get item action ?!

    i need to fix that field assigned to is responsible of the department, i need expression for this field. to send dynamically approval email. 

    Schermata da 2023-06-01 10-41-24.png

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: expression lookup field for approval flow

    Hi @Sam2089 

     

    You can get the Id of the lookup column using the dynamic content. In the below example, I have used compose action to get the Id of lookup column 'Department' when a new item is added in 'Document' list:

    ManishSolanki_0-1685605738222.png

     

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

     

    Thanks

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard