I have a List which has 10 columns. One of the columns is a name field which the user is supposed to enter and based on that we have to return a column value (which the user wants like marks in Mathematics). So the operations are user will enter a name. We will ask what field you want to see and then we'll display the field value for that particular name. How to write the call action for this chatbot in virtual power agents?
Hi @Ayush107,
Multiple call actions shouldn't be needed. You should be able to ask more questions and collect different answers from the interaction of the user and send them all in one call action as input and get one set of results as output.
Just use more input options in your flow setup for that.
Thank you for this solution. This was really helpful. Can you help me out with a more optimized solution for this?
Let me give you an example. If the user wants to get UPI, I need to create a separate call action which will get triggered once UPI is an input. But if there are 50 fields, it will be very difficult to create separate call actions for each one of them.
What I want is the user to input two things: one is the name and the other is the field name. Then my call action gives me the output of the input field for that particular name. I just want to reduce the number of call actions that I have to create.
Let me know if you have any questions regarding my request. Please help me out on this.
Hi @Ayush_07,
In that case you won't need that bot.UserId or bot.UserDisplayName.
Below is an adjusted example.
1. Create a flow like below. Which I think type you almost had finished. Only difference compare to yours is that I use a Number output variable the end called UPI and I only store the UPI value in there.
Topic setup
2. Use a question, Which Rep Name?. Select the type user's entire response. Save the response in a VarRepName text variable.
3. Use a call to action. Select the flow you created in step 1. Map Name to varRepName.
4. Add a Message action. Show the UPI value.
Please find below the headers and a sample record for the list file.
This will be a bot that will be used in our organization. So no authentication is required.
If I type the Rep Name, I expect UPI to shown as a result.
Please help me out on this.
Hi @Ayush_07,
Yes, I can help out with your structure. I think your overall approach (storing an Excel in a SharePoint library and retrieving the data from there) would also be possible.
However, I have a couple of questions before I can help out.
1. Can you share a screenshot of your Excel sheet so I can see the structure of it? Obfuscate data were needed.
2. Have you setup authentication in the bot and mapped the bot.UserId or bot.UserDisplayName to your Name field of the Power Automate flow in the Action in the Authoring Canvas of your Topic?
3. Can you share an example of what you would type in the chatbot and which row you would expect to be shown from the Excel workbook?
Thanks a ton for taking so much of your time to help me out. Really appreciate it!!!
Can you please help me out on the Get Items part. I have an excel file having numerous records and I have created a microsoft list of that record by uploading a the excel on it.
Please help me out to structure the call action one. If the method that I have uploaded the pic of makes no sense, please Suggest me alternate method. I was not able to exactly understand your method. Please add detailed step on that if that is an easier way to get the job done. Thanks in advance
Hi @Ayush_07,
Are the users which will interact with the bot part of your organisation/microsoft 365 tenant? If so, you could use authentication in the bot and you wouldn't need to ask them their name.
https://docs.microsoft.com/en-us/power-virtual-agents/configuration-end-user-authentication
For the list and looking up the values you can use a call a action with a Power Automate flow. In the Get items action of the flow you could filter for the correct value.
Below is an example of that approach.
1. The topic with the action.
2. The flow which retrieves the correct items from the list and sends them back to the chatbot.
Let me know if you need any more help or details of the setup.