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 / Pull and Add Items fro...
Copilot Studio
Unanswered

Pull and Add Items from SharePoint using Power Virtual Agent

(0) ShareShare
ReportReport
Posted on by

Hi There,

 

I am working on a Power Virtual Agents bot and a little bit stuck - it should return a column value by searching for an employee ID.

 

The purpose of the Topic:

 

  1. Topic triggered by Search, Search employee expression
  2. Chatbox asks for employee ID input
  3. The user gives the employee ID
  4. chatbot search a Sharepoint list (Employee ID is an integer, its unique key but there is another column (string) called Part of Process... :
    1. If there is NO match: The chatbot returns a message: Employee is not in our database, would you like to add the employee to the database?
      1. Yes
        1. Flow asks the user for input for the Part of Process... column
        2. Flow creates a new item with employee ID and add recorded value to the Part of Process... column
      2. No - End of Conversation
    2. If there is a match: The Chatbot finds a match and return the employee's Part of Process... value

My current flows run successfully but no matter what employee ID I search for in the bot it gives me the last entry (last employee's Part of Process... value).

 

Here I've saved all the Screenshots: https://ent.box.com/s/7v0u1fbrphmit6tsh35m155dwpvwba4r

 

Thanks for any help,

 

Kristof

Categories:
I have the same question (0)
  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @Anonymous ,

     

    Today, you use the Apply to each to filter or something like that, and your performance will be affected a lot.

    I recommend you to use this article to create a filter inside your workflow (Power Automate): Solved: Search SharePoint Site for file - Power Platform Community (microsoft.com)

     

    Inside your workflow, create one variable called "Message" as string type. Define per default "Employee is not in our database, would you like to add the employee to the database?"

    You will use to define a value inside the Apply to each (with the filter applied above) like Part of Process value.

     

    Also, you will create one variable called "Result" as boolean type.

    You will define per default "false" and inside the Apply to each (with filter applied above), you can define as "true".

     

    And finally, you will create two outputs to return to your chatbot.

    "Result" - Boolean - using the variable created

    "Message" - String - using the variable created

     

    Power Virtual Agents

    Inside your topic, create a condition after this workflow, reading the Result variable and see if is 0 or 1 (boolean values come from Power Automate inside PVA is 0 and 1 to true/false).

    For each condition, you will show a message using the Message variable (Power Automate).

     

    If is "false", you can create a question if the user wants to create an employee.

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 255 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

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

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard