Hi all,
I try to create a PVA for my company to manage the leaves request for the employees.
A created the Bot and first it asks if the employee if he wants to take some hours or some days.
Then the bot asks how many days/hours he wants to take. I want to substract this amount to a SharePoint list with the columns to refer the hours/days he has.
My question is : How can I update this item using the PVA? I wanted to create the flow to Update the item, unfortunately, I'm facing some issues with that :
- How can I identify the user who is asking a leave request?
- I need to update a specific field in my list but the flow is asking me some ID and Title mandatory fields to update the item.
Could you please help me?
Hello, thank you for the answer.
I stored the answers in another SP list to solve the issue.
Move return value(s) to PVA to the top before approval and return some value and based on return value redirect to another topic so that approval still runs at the background and after approval may be a adaptive card in teams that your leave is approved.
Hey,
Thank you, I tried something like that and it's working pretty well.
I would like to add an "Approval" step for the leaves. But I have an issue with a delay.
I added the step and it's working pretty well but if the approver send the answer 1h ou more after the asking I have a 3002 error.
Is it possible to store the appoving step and recover the chat discussion just after?
Hi @Varik,
You can enable authentication in your bot and use the bot.UserId to identify the user. If you have a column in your list which is of type person you could use a OData filter query to identify the correct list item and update that one.
Below are a couple examples of that approach.
In this example the following list setup was used btw.
1. Setup your Power Virtual Agent authentication
2. Make sure you have a topic like below.
3. For the Power Automate flow setup make sure you have input variables (LeaveRequest of type number and UserId of type text) in the trigger action.
4. Use the UserId field in the Get User action.
5. Use a Filter query in the Get Items action.
Employee/EMail eq '@{outputs('Get_user')?['body/mail']}'
6. Use the first row from the outputs of the Get Items in your update action. These are three expressions for the ID, Title and Total Amount of Days columns
outputs('Get_items')?['body/value'][0]['ID']
outputs('Get_items')?['body/value'][0]['Title']
sub(outputs('Get_items')?['body/value'][0]['TotalAmountofDays'],triggerBody()['number'])
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional