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
@AWorley please check your msg inbox, i sent a message to you. thanks
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.
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?
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.
it give me error
@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 ----->
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?
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.
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.
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:
If this helps, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks