I am trying to understand how to set up an Action from PVA to create a new record in a custom entity but I am having issues understanding how to set the Input section, and Return values. I also am not sure where to add the "Create a New Record" and where it should be placed on the page and how to use the variables in the "Create a new Record" action. I have about 7 variables that need to be placed in the custom entity. This is really my first flow so I appreciate any help!
Hello @bradlaw
What is the status on your question. If your problem was solved, could you accept a solution, this will help others find answers more quickly.
Thanks
Thanks, and I see it will actually create a record. thanks again and I subscribed to your channel!
Yes @bradlaw , you can test your chatbot or publish and test inside the Demo website channel.
Awwwww. I think I got it, I simply wasn't returning back to PVA to match the variables. lol
Now I shouldn't expect to be able to test this out from either PVA or PA?
Hi @bradlaw ,
Follow below my comments:
Ok this helps me formula my questions and clarify a few things.
Date - string
Title - string
Type - string
Hi @bradlaw ,
No worries, I'll send an example below and I hope that can help you:
Common Data Service (entities)
I created an entity called "Expenses" with fields: Date, Title, and Type.
Power Virtual Agents (chatbot)
I created a chatbot that has a topic called "Register an expense" with trigger phrases: I want to register an expense, ...
Inside this topic, I created 3 questions:
1- When do you want to register this expense? (identity: User's response | output variable: Date)
2- What's the name of your expense? (identity: User's response | output variable: Title)
3- What's the type of expense? (identity: User's response | output variable: Type)
4- Create an action calling the Power Automate
Power Automate (workflow)
I created a workflow that the trigger is the Power Virtual Agents (similar that you posted) and the inputs is:
Date - string
Title - string
Type - string
I created an action called "Create a new record" using the Common Data Service (similar that you posted) and connect the entity with my Expenses entity.
Now, I can see some inputs that need that I selected, like Date, Title and Type, and I can see on the Dynamic content all values come from Power Virtual Agents trigger.
I select one by one.
I created an action called "return value(s) to Power Virtual Agents" (similar that you posted) and I can create output variable or no, I decide if I want or no.
If I want to return to Power Virtual Agents the Title of my Expense, I need to create an output called "TitleResult" and select the value on the Dynamic content.
Power Virtual Agents (chatbot)
Now, you can create an action calling from Power Automate and select your workflow, select all inputs with the topic variables.
And after the workflow action inside the topic, you can create a message to the user like:
Thanks, you create an expense called: {and here, you can see the {x} icon on the message, and use the TitleResult here}