Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - Calling Actions from Copilot S...
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? 

  • Verified answer
    Varik Profile Picture
    65 on at
    Re: Update SharePoint list depending of the user's answer

    Hello, thank you for the answer. 

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

  • Sagardpilli Profile Picture
    4 on at
    Re: Update SharePoint list depending of the user's answer

    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.

  • Varik Profile Picture
    65 on at
    Re: Update SharePoint list depending of the user's answer

    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?

     

  • Expiscornovus Profile Picture
    31,635 Most Valuable Professional on at
    Re: Update SharePoint list depending of the user's answer

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics