cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StefanBreedveld
Level: Powered On

Get value from sharepoint list column into variable and show it in email

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.

 

Capture.JPG

 

 

4 REPLIES 4
Dual Super User
Dual Super User

Re: Get value from sharepoint list column into variable and show it in email

@StefanBreedveld 

In Flow, the output obtained from Sharepoint column will probably be a string.

I would recommend to use the expression float() as suggested in this post.

Expressions examples, here.

Hope this helps

 

 





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





Community Support Team
Community Support Team

Re: Get value from sharepoint list column into variable and show it in email

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.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
StefanBreedveld
Level: Powered On

Re: Get value from sharepoint list column into variable and show it in email

Hi Barry,

 

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.

Community Support Team
Community Support Team

Re: Get value from sharepoint list column into variable and show it in email

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.

Image reference:

80.PNG81.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,654)