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

Creating flow for PVA Chatbot using SharePoint

Hello,

sipark09_2-1656354812733.png

 

I'm building a chatbot (shown above) where the user provides the link, just like the one below (which is not a SharePoint link, just one of the column value in this list) and trying to get the ID number that corresponds with the URL which is randomly assigned by SharePoint. Is that possible and if so, how do I achieve that?

sipark09_0-1656354502886.png

sipark09_1-1656354567312.png

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

That's OK, I misunderstood because as mentioned earlier, I'd edited the solution and the condition is now step 4.

 

A condition has 3 parts and they're made up thusly:

Left Middle Right
First value to compare Comparison method Second value to compare
itemsCountVAR is equal to 1
You have the count of results from the Get items action here. You are asking for the number there to be equal to the number on the right. You have entered the number 1 here to 

 

So your Condition is there to check if the Get items even found anything, if it didn't then something has gone wrong. You need to account for that.

 

I can't emphasise enough, @sipark09, that you need to try things out ... without actually doing something, you won't see mistakes and learn from them.

 

So ... If you don't know how a Condition works? Make a flow with a Condition and try a few different ways of doing it ... If you don't know how to write an expression, make a test flow to see how that works.

 

Delete these test flows afterwards, but that's where you get your water wings.

 

Most important of all, never think literally about a problem. 😉

View solution in original post

9 REPLIES 9
eliotcole
Super User
Super User

  1. Delete the Get item action and make a Get items action.

  2. Tap the 'Show advanced options' on the Get items action, and use the 'Filter Query' field there to filter the URL field by the value that they enter.

    If this is a unique value, then your Get items action will either return 0 or 1 results.

  3. Create an Integer variable called itemsCountVAR, and in that make an expression which uses the length() function on the Get item body/value array.

  4. Then after the variable, run a Condition action on itemsCountVAR in the left side, equals in the middle and the number 1 on the right.
    1. Your YES branch is to return the result.
    2. Your NO branch returns an error.

That should sort you out.

 

EDIT - Changed the first step, thanks to @Pstork1's sharp eyes!

Hi @eliotcole ,

 

I don't see a 'Filter Query'.

Also I'm slightly lost with the 2nd step. 

sipark09_0-1656356938100.png

 

@eliotcole is mostly correct in his response.  However he is referring to the Get Items action, which is what you should be using instead of the Get Item action.  Get Item requires that you have the ID of a specific item.  Since that is what you are trying to retrieve you need to do either a Get Items with an Odata filter or a Get Items which you then filter with a Filter Array action.  There is nowhere to put an OData query in the Get Item action.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

For the variable, create a new action, and select the built in connectors, then select variables, then select Initialize variable.

 

Once you have the Initialize variable action on screen, you can select Integer as the variable type.

 

For the filter query ... you raise a good point, it's like @Pstork1 said ... I'll update my original solution.


Ah, yes, my mistake, thanks, @Pstork1 !

Hi @eliotcole

 

Could you explain the third step again please. 

 

@sipark09 ... these are kind of the first things that you should learn before trying to use power automate.

 

It might be an idea to just do a couple of beginner flows, so that you can get the hang of what's going on here.

 

To make any kind of variable (an integer variable is a number one which only accepts whole numbers) you first need to Initialize the variable earlier in the flow.

 

To initialize a variable you select the following options:

add an action.jpg

choose variable.jpg

initialize variable.jpg

select your type.jpg

Hi @eliotcole ,

 

I understand how to make a variable, however, I don't really follow what you meant by the condition part. Sorry if I'm not being clear with what I'm asking. (Sorry, I meant the 4th step now)

That's OK, I misunderstood because as mentioned earlier, I'd edited the solution and the condition is now step 4.

 

A condition has 3 parts and they're made up thusly:

Left Middle Right
First value to compare Comparison method Second value to compare
itemsCountVAR is equal to 1
You have the count of results from the Get items action here. You are asking for the number there to be equal to the number on the right. You have entered the number 1 here to 

 

So your Condition is there to check if the Get items even found anything, if it didn't then something has gone wrong. You need to account for that.

 

I can't emphasise enough, @sipark09, that you need to try things out ... without actually doing something, you won't see mistakes and learn from them.

 

So ... If you don't know how a Condition works? Make a flow with a Condition and try a few different ways of doing it ... If you don't know how to write an expression, make a test flow to see how that works.

 

Delete these test flows afterwards, but that's where you get your water wings.

 

Most important of all, never think literally about a problem. 😉

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 (1,466)