cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VeeLearnMSFT
Post Patron
Post Patron

PVA Return Sharepoint Files unable to Return Items

A little frustrated, trying to get this flow working all day.  I was trying to use @renatromano flow so I could replicate but but cannot get anything to return.  I am trying to crate a PVA bot that would return a list of files based off of search input.  So I would ask the bot to look for files inside of sharepiont. I would enter a text search, which could be a partial of the file OR Contains.  And then the bot would reutrn a list of files and their corresponding folder if possible.  Can someone kindly look at my flow to see where I am going wrong.  12 hours of work and still not results. Please help! 

1. 

VeeLearnMSFT_0-1651453584108.png

2. 

VeeLearnMSFT_1-1651453662347.png

Nothing is returing back.  I spent all day trying to get this to work. Im not ready to throw in the towel as I know I am way too new at this. I am stuck and I cannot get a search to work to return files.

 

VeeLearnMSFT_2-1651453884140.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Rhiassuring
Community Champion
Community Champion

WELP - I've just learned something from you, and also from a past @Pstork1 post.

Just built my first bot, and, figured out the issue here!

When passing links back to the PVA, you want to use the format of [TITLE](link). 

Check this out:  https://docs.microsoft.com/en-us/power-automate/approvals-markdown-support#links

My string looked like this:

Rhiassuring_3-1651634894013.png

 

 

 

And here's the output:

Rhiassuring_2-1651634874448.png

 

Uh oh, these bots are fun...

...oh and $1280 a month apparently. ..WELP.

 

 

 

 

 

View solution in original post

Hi @VeeLearnMSFT 

 

I appreciate you tracking me down on Reddit regarding my video https://youtu.be/mfKa4i9yYtY on a DHL ChatBot.  I think you are almost there to be honest.  Rather than using title for the markdown, use Name i.e. filename and that will sort the empty [] I see in your screenshot.  Regarding the 3000 error, I am unsure but having just built this entirely from scratch in 5 mins, this works OK for me.

 

Here is an example of a working flow:

DamoBird365_0-1651682617666.png

 

This is what the PVA map looks like:

DamoBird365_1-1651682661539.png

 

And an example conversation:

DamoBird365_2-1651682691854.png

 

The only other thing I cannot see from your screenshot is the final message back to the user?  I actually removed that step as a test, so all the PVA does is run the flow and doesn't return a message and mine still runs OK, albeit it doesn't respond.  So I am wondering at what point your PVA fails and returns the error?  You should be able to play it back in the test bot and see where the process fails and possibly share the final part of the PVA map?

 

Damien

View solution in original post

18 REPLIES 18
Rhiassuring
Community Champion
Community Champion

Can we please see the inside of your Append to String Variable? 

Your error says there is an issue with that action.

I see the data coming in to the Filter Array but it does not show any output. It just seems to stop there.

 

 

VeeLearnMSFT_2-1651488041857.png

VeeLearnMSFT_3-1651488347820.png

 

VeeLearnMSFT_4-1651488439338.png

 

I changed the flow slightly.  I got rid of the filter array and filtering right using the filter query:  

VeeLearnMSFT_0-1651580635926.png

VeeLearnMSFT_1-1651580671707.png

It came back with 10 records:

VeeLearnMSFT_2-1651580704397.png

Now the flow is returning values all the way to the agent but the agent is not returning anythign in the chat window. I dont understand why, is it the type of data that is not in the format it requires?

VeeLearnMSFT_0-1651580942679.png

 

 

Here is my error from the bot:

VeeLearnMSFT_1-1651580973817.png

 

Rhiassuring
Community Champion
Community Champion

In your last screenshot, it looks like you are appending the variable "Link" to itself, without any content in it..?

what is the proper way to do it...Do i need to put the Name instead of link?  Can you show me a screenshot of what it should look like?  Sorry I am just too knew and I am not quite sure how to fix it.

Rhiassuring
Community Champion
Community Champion

It's okay, Vee, we'll get there.

 

So right now, you are filling a blank variable (Link) with itself - which is blank. So ... blank!

Instead, try this: 

Rhiassuring_2-1651612253336.png

 

Where I have txtTable, you'll have your Link variable - where I have "Link to Item", you'll select the Dynamic Content from your Get Files output, and you should have the same thing to select, "Link to Item". Now, we're storing that link in the variable - and since it's an APPEND to string variable, it's going to put it right alongside whatever other values we add. 

 

Note I have a "; " after - a semi-colon, and a space - because the Append to String Variable action will literally put them sidebyside unless we tell it not to! 

Also, a tip: I recommend (and this is a personal thing, of course, I am sure we will have plenty of folks  here disagree) naming variables with a prefix. This helps more easily identify their purpose, so you won't see "Link" and wonder what kind of variable it is.  Examples: intSharePointID, txtNameOfDoc, arrDepartments...  (some people prefer str over txt, which I get - txt is a habit for me.) 

I am still missing something. I apologize if am a severe bother 😞

This is part of my flow revised:

 

VeeLearnMSFT_2-1651614597725.png

 

VeeLearnMSFT_1-1651614576147.png

Here is what it returned: I see the 10 items coming in...but see further below.

VeeLearnMSFT_5-1651615026448.png

 

VeeLearnMSFT_3-1651614882804.png

VeeLearnMSFT_4-1651614893257.png

Am I getting close?

 

Rhiassuring
Community Champion
Community Champion

Errrr.. hard to tell. I don't know what "Kada" is, at all... 

And, for 'txtTable' - that will still be your variable called Link, you don't need to rename it to what I've used 😛 

Let me give a test on my side, and I'll report back in a sec.... I've never used a chat bot before.


VeeLearnMSFT
Post Patron
Post Patron

I know but I wanted to impress you 😞 so I am passing a text string through the bot which is the name of the file.  The file contains Kadaj in side of it.  It is pulling all instances matching Kadaj string.  But what I dont get is why is it bunching kadaj and the link to the file right next to each other.  I just thought  it was weird and perhaps this is why it stopped.  I mean I see the links being outputed in the body of the return to virtual agent box.  I just dont know why its not returning anything.  

 

VeeLearnMSFT_0-1651622342120.png

 

Rhiassuring
Community Champion
Community Champion

WELP - I've just learned something from you, and also from a past @Pstork1 post.

Just built my first bot, and, figured out the issue here!

When passing links back to the PVA, you want to use the format of [TITLE](link). 

Check this out:  https://docs.microsoft.com/en-us/power-automate/approvals-markdown-support#links

My string looked like this:

Rhiassuring_3-1651634894013.png

 

 

 

And here's the output:

Rhiassuring_2-1651634874448.png

 

Uh oh, these bots are fun...

...oh and $1280 a month apparently. ..WELP.

 

 

 

 

 

VeeLearnMSFT
Post Patron
Post Patron

I dont know what else to do. Im at a loss, I have been at it for days and you have been so gracious taking your time to help me but nothing seems to work.  I still get the same error.  

 

1. 

VeeLearnMSFT_1-1651662134722.png

 

2. 

VeeLearnMSFT_2-1651662146831.png

3.

VeeLearnMSFT_4-1651662311436.png

4.

VeeLearnMSFT_5-1651662365878.png

Output from audit:

VeeLearnMSFT_3-1651662249967.png

 

 

This is how it is coming to the Return value(s) to Power Virtual Agent:

VeeLearnMSFT_0-1651662106157.png

 

VeeLearnMSFT_7-1651662485396.png

 

Chat Bot:

1st screenshot:

VeeLearnMSFT_8-1651662526796.png

VeeLearnMSFT_9-1651662537587.png

This is the sharepoint site.

VeeLearnMSFT_10-1651662840082.png

 

 

Hi @VeeLearnMSFT 

 

I appreciate you tracking me down on Reddit regarding my video https://youtu.be/mfKa4i9yYtY on a DHL ChatBot.  I think you are almost there to be honest.  Rather than using title for the markdown, use Name i.e. filename and that will sort the empty [] I see in your screenshot.  Regarding the 3000 error, I am unsure but having just built this entirely from scratch in 5 mins, this works OK for me.

 

Here is an example of a working flow:

DamoBird365_0-1651682617666.png

 

This is what the PVA map looks like:

DamoBird365_1-1651682661539.png

 

And an example conversation:

DamoBird365_2-1651682691854.png

 

The only other thing I cannot see from your screenshot is the final message back to the user?  I actually removed that step as a test, so all the PVA does is run the flow and doesn't return a message and mine still runs OK, albeit it doesn't respond.  So I am wondering at what point your PVA fails and returns the error?  You should be able to play it back in the test bot and see where the process fails and possibly share the final part of the PVA map?

 

Damien

Hi @VeeLearnMSFT 

 

Did you crack it?

 

Damien

VeeLearnMSFT
Post Patron
Post Patron

First of all a big thank you @Rhiassuring and @DamoBird365.  You guys do not know how happy I am. I know it doesnt take much right?  You guys didnt give up on my issue and you have been so gracious with your time.  I honestly appreciate you guys so much and I wish I could clone you.  I have been struggling days at this and finally we got it to work all thanks to you guys.

 

After reading everything you guys have said again it convinced me to start over.  I deletd the bot, I deleted the flows, I put on a new face and wouldnt you know it....IT WORKS NOW. I have no idea why it was giving me so many errors.  I have no idea what changed but by starting over it did something.  I did however add the closing loop on the end of the bot trigger flow.  I added an eding message box and put in the closing output variable.  Perhaps this was one of those things that added to it.  Doing this for the very first time certainly helped me learn alot from you guys.

 

if I may one last question, You can see that the bot out puts some data but its a bit messy:  Can I force it to give the out put in a cleaner format.  Maybe like the subfolder and the file name.  So in this case it would be [2022 CY2022 Compensation - 2022 BenchmarksBencharks] the name but the link being only the folder name it is in, and I mean the subfolder because the root folder would be like the Year 

 

So in this case would be just: 

VeeLearnMSFT_2-1651691290696.png

and then the file name.  

Or maybe even add some bullet points?  Not sure what are the format options to put put so its easier to read.

 

 

 

VeeLearnMSFT_0-1651690863685.png

 

THANK YOU THANK YOU THANK YOU GUYS..super happy we got this working!

Hi @VeeLearnMSFT 

 

Glad you've cracked it and agreed, @Rhiassuring is doing a great job here too.

 

I think you inadvertently added a - to the markdown which is quite picky and this has resulted in the full URL being displayed.  Take a look at my example.

 

DamoBird365_0-1651695557442.png  

 

You need to add a new line to your string for formatting.  @tom_riha's blog shows you how to add a return line How to add new line ('\n') to a string in Power Automate (tomriha.com) with the expression decodeUriComponent('%0A').

 

I've added folder path to the name in the append to string and also a - at the start of the line, which is a bullet mark in markdown. Use markdown to format Power Automate approvals - Power Automate | Microsoft Docs

 

This results in the following output:

DamoBird365_1-1651695752111.png

Good luck!

 

Damien

 

 

Almost there but I have no idea why my dynamic functions are not showing up in the teams environment. Usually when I click in any of those areas in flow.microsoft.com and there are possibilities of dynamic functions a window shows up to the side.  It doesnt come up anywhere.  I am not sure why.  

 

Is there another way I can get the decodeUri.... function?

 

 

VeeLearnMSFT_1-1651697129226.png

 

Hi @VeeLearnMSFT 

 

Genuinely, I think Power Automate is being upgraded! I was having problems too tonight. It looks like experimental features are being made permanent. Try zooming out and the expression builder may appear. Otherwise try tomorrow.

 

Damien

Nevermind, I figured it out..Apparently when the screen resolutions drops below a certain threshold it gets rid of dynamic content.  

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,287)