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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Using PVA User Name to...
Copilot Studio
Unanswered

Using PVA User Name to Get Items from SharePoint

(0) ShareShare
ReportReport
Posted on by 16

Hi,

I want to be able to do a Call to Action whereby the User's name is taken from PVA/Office 365 and used to filter and Get Item from a SharePoint List. The two SharePoint Columns are

 

  • "Title" - the name of the Pod
  • "Name" - Person lookup column

 

IE is Sally is using the PVA, the Flow would find Sally in Office 365, use the O365 Connector to find her email address, use the email address to lookup the correct person in the "Name" list column and get the corresponding information from the "Title" column.

 

It works find when I test it in an Instant flow, but when I try and put it in a PVA flow, it comes up with an error on the "Return value(s) to Power Virtual Agents" action:

 

"The output you selected is inside a collection and needs to be looped over to be accessed. This action cannot be inside a foreach."

 

Here is what I have created so far. Can anyone help?

 

stanswell84_0-1684518984639.png

 

 

 

 

 

I have the same question (0)
  • Pstork1 Profile Picture
    68,923 Most Valuable Professional on at

    The problem is that the Get Items is going to return an array of records. It may be 0, 1, or more than one. But you need to process the array to turn it into some form of string to be able to return it to the Bot.  If you are expecting just one match you can use First()?['Title'] to get the Title column of the first record returned.  Otherwise you'll need to use the markdown language to format the table as a string.

  • stanswell84 Profile Picture
    16 on at

    Thanks @Pstork1  - where would I write First()?['Title'] ?

  • Pstork1 Profile Picture
    68,923 Most Valuable Professional on at

    In the field where you return the value to the Bot.  First() would go around the Values dynamic content from the GetItems.  That will give you the first item that was retrieved.  Adding ?['Title'] would return just the Title field value from that first record.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 177

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 130 Super User 2026 Season 1

#3
chiaraalina Profile Picture

chiaraalina 45 Super User 2026 Season 1

Last 30 days Overall leaderboard