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

Update single item from Sharepoint list /w PVA

Hello dear community! I have posted the same message to the Building flows board but unfortunately no one has responded so i will try my luck here 🙂

Im struggling with building my first PVA bot for my employees and i have one problem with Update item. 
I want to do following thing: one specific user (i know how to make it) could edit Vacation Days in sharepoint list with help of PVA after vacation approval was successfuly done. 

My sharepoint looks like this: Screenshot_29.png

VacDays_1.01 - the amount of days that an employee has at the beggining of the year
VacDaysUsed - the amount of days that have been consumed during the year

VacDaysLeft - the amount of days that an employee has left (this column has been calculated through subtraction of first 2 columns)

And here how bot is supposed to work:

Bot: Please, enter the name of Employee. 
User: John Johnson

Bot: Please enter the number of days that have been taken for last Vacation approval

User: 10
Bot: Thanks, the amount of days left is now set to (X-10).

So...in power automate i have tried so many things, but none of them worked out. I have tried to Get items and then Update them but everytime i had some problems, maybe because i dont know how exactly i need to configurate this. So basically i need that amount of days that have been used in recent vacation approval would reduce the number of VacDays_1.01 by user input (10 in my case) and increase of VacDaysUsed by user choice (well also 10).

Would be very grateful if someone could explain to me at least how Update thing should be configurated, every other thing i will achieve by myself 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @SpaceNudeln 

 

You can build it up using the expression builder, type int() and then select the dynamic content tab and you should be able to select the DaysUsedREC value.  Alternatively, you can temporarily add the input to a compose or similar and hover over the dynamic value for the expression like so.

DamoBird365_1-1616770652897.png

triggerBody()['number']

 

e.g. int(triggerBody()['number'])

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

3 REPLIES 3
DamoBird365
Super User
Super User

Hi @SpaceNudeln 

 

Have you explored the add or sub expression?

 

add(10,5) OR sub (10,5)

 

Please note if the value is returned as a string from sharepoint, you will need to use int(). 

e.g.

int(('Get_item')?['body/VacDays_1.01']) //albeit you need to check the correct expression for your field.

 

 

DamoBird365_1-1616768599695.png

 

 

DamoBird365_0-1616768584703.png

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

 

Thanks for the tipp, yes, i have already explored this one, but the thing is i cant understand how can i express User°s input (on the screenshot) as variable for the subtraction? In my case its DaysUsedREC (recently)

SpaceNudeln_0-1616770166634.png

How should it be then?

sub(int(('Get_item')?['body/VacDays_1.01']),int(DaysUsedREC)) ?
My column from Sharepoint is a Number (not a string)

 

Hi @SpaceNudeln 

 

You can build it up using the expression builder, type int() and then select the dynamic content tab and you should be able to select the DaysUsedREC value.  Alternatively, you can temporarily add the input to a compose or similar and hover over the dynamic value for the expression like so.

DamoBird365_1-1616770652897.png

triggerBody()['number']

 

e.g. int(triggerBody()['number'])

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,170)