cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Search Document in Share Point and Return to Power Virtual Agent (String URL)

Hello I'm newbie at Power Automate,

I want to create chat bots using specific file name using Power Virtual Agents

I already make a bot that call an action to power automate using specific phrase like this :

Me : Search Document

Bot : File Name ?

Me : Book.xlsx

 

I already make Power Automate using Get Files (Properties Only) Input from Power Virtual Agents is string values (Book.xlsx) But cannot return value "Link to Item" (URL) back to Power Virtual Agents

 

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

 

My Filter Query is : Title eq 'Book1.xlxs'

 

Any ideas? Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @tkevinwikarta 

After the Get Files (properties only) action, initialize a string variable and assign the below dynamic expression as the value

first(outputs('Get_files_(properties_only)')?['body/value'])?['{Link}']

The above expression will take the first result of Link property from the collection and store it in the variable. You can pass this value to the powerapps.

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Hi, whether you search for the files or items using the title or any other fields, it returns more than one result. Even there is only one result returned from the search, it is returned as an array. You have to make sure to handle the array response.
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...
Highlighted

Hi Thanks for your advice

I'm sorry, I have no idea how to handle an array on power automate?

Is there any connector/function to get a single variable on Array from Get Items (Properties Only)?
Like First(Array) or something

Sorry I'm still confuse how to get the First array Link to Item from Get Items (Properties Only)
Also I need to convert the link to Item into String variable so it can returned to Power Virtual Agents

Highlighted

Hi @tkevinwikarta 

After the Get Files (properties only) action, initialize a string variable and assign the below dynamic expression as the value

first(outputs('Get_files_(properties_only)')?['body/value'])?['{Link}']

The above expression will take the first result of Link property from the collection and store it in the variable. You can pass this value to the powerapps.

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

Highlighted

Thank You @sudharsan1985 
its working right now 😁


Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (7,977)