I have two SharePoint lists, List A and List B. I building a workflow on List A (when item is created) and want to get a value from number column 'Hours Left' from List B.
How can i get the value 'Hours Left' from List B into a variable and use it in the workflow. For example to show this value in the body of an email.
So far I used the 'Get items' action on List B and tried to initialize a variable and then use the 'Set variable' action.
I also tried with expression triggerBody(), but I can't get this to work either.
Hi @StefanBreedveld ,
Could you provide more details about your requirement and Flow configuration？
Do you want to get Hours Left contained in a specified item from List B?
According to your configuration, the value of the variable will be the Hour Left contained in the item with minimum ID in List B.
Please provide more details so that we could provide a proper workaround for you.
List A will be leave request form for employees. List B will contain some properties (for example; 'Total Hours', Total Hours Last Year', 'Hours Used', 'Hours Left', etc. ) about the employee. So every employee will have his own record in List B.
When employee create a leave request in List A an approval workflow will start. Here I want to approve the leave request and when the approval is accepted the workflow must send a email to the employee with the 'Hours Left' value from List B. This to inform the employee how many leave hours he has left for this year.
I also want to do some calculations with the 'Hours Left' value, so my thought is to make a variable to used it in multple places in the workflow.
In the past I already created this workflow in SharePoint Designer (SharePoint 2013 workflow). Here I created a local variable and used this in the action 'Set workflow variable' with a connection to a different data source (List B) and return the field As String. As matching value that identifies the specific item I used the 'Employee' column (people picker) from List B and 'Name' column (people picker) from List A.
Hi @StefanBreedveld ,
It seems that you want to get the Hours Left value of the specified user in List B.
You could use Condition to filter the current user-related item in List B.
Suppose there is an Employee(Person Type) column in List B.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!