cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Dual Super User III
Dual Super User III

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

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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.

Highlighted
Community Support
Community Support

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
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (3,632)