web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Update SharePoint list...
Copilot Studio
Answered

Update SharePoint list depending of the user's answer

(0) ShareShare
ReportReport
Posted on by 65

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? 

I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    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.

     

    setupoflist.png

     

    1. Setup your Power Virtual Agent authentication

     

    auth_pva.png

     

    2. Make sure you have a topic like below.

     

    LeaveRequest_PVA.gif

     

    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'])

     

     

     

    flow_leaverequest.png

  • Varik Profile Picture
    65 on at

    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?

     

  • Sagardpilli Profile Picture
    4 on at

    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.

  • Verified answer
    Varik Profile Picture
    65 on at

    Hello, thank you for the answer. 

    I stored the answers in another SP list to solve the issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 250 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 197 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 103 Moderator

Last 30 days Overall leaderboard