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

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

5 REPLIES 5
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...

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

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

Thank You @sudharsan1985 
its working right now 😁


Hi 🙂

Can you show me a screenshot of your solution to this problem? I have the same problem, but I don't understand this solution...:(

 

 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (10,817)