Skip to main content

Notifications

Calling Actions from Copilot Studio
Unanswered

Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

Posted on by

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!

 

bradlaw_0-1601934083908.png

 

  • Jcook Profile Picture
    Jcook 7,765 on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    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

  • bradlaw Profile Picture
    bradlaw on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    Thanks, and I see it will actually create a record. thanks again and I subscribed to your channel!

  • renatoromao Profile Picture
    renatoromao 6,762 on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    Yes @bradlaw , you can test your chatbot or publish and test inside the Demo website channel.

  • bradlaw Profile Picture
    bradlaw on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    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?

  • renatoromao Profile Picture
    renatoromao 6,762 on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    Hi @bradlaw ,

     

    Follow below my comments:

     

    1. In my use case a user is selecting from a few options I give them that I want to use to create a new record with. I am not using "User input fields," open text fields from PVA. I am using the results of items the user selects that I defined as "Entity" options in PVA. they are pre set Topics, Sub-Topics and Inquiry Types all set up as Entities in PVA. 
      No worries, you can use the values selected by the user inside the question with identity connected to the Entities (PVA).

    2. When I create Topics, Sub-Topics and Inquiry Types in Power Automate (Power Virtual Agent section where you create the variables) I can only see them in Power Automate Dynamics Content if I am selecting a fields that isn't an Option Set in CDS. These are Option Sets in CDS, not text fields. 
      If you are using the Option Sets, you will need a more complex scenario to do it because of which option is a code inside the CDS database. I recommend you to change the type of field inside your CDS entity.
    3. When you use the following variables, are these the same name as the variables in PVA? I am not seeing the relationship between the variables defined in Power Automate (Power Virtual Agent section where you create the variables) and the Dynamics Content? I guess I expected the Dynamics Content to be populated with the variables defined from PVA?
      I create the same name to help you, but you can create inside your workflow (Power Automate) three inputs called "NumberOne, NumberTwo, NumberThree". Inside your PVA topic, you will see the three inputs that you will relate with your question that you send to the user. And inside your workflow (Power Automate), you will see the three inputs inside the Dynamic content.
      You can see my video here: https://www.youtube.com/watch?v=aJN-2QkT3Uc&list=PLWGKTxKF5vWc9YwqLkZB34oqJ1FGxrlSk&index=9

     

  • bradlaw Profile Picture
    bradlaw on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    Ok this helps me formula  my questions and clarify a few things. 

     

    1. In my use case a user is selecting from a few options I give them that I want to use to create a new record with. I am not using "User input fields," open text fields from PVA. I am using the results of items the user selects that I defined as "Entity" options in PVA. they are pre set Topics, Sub-Topics and Inquiry Types all set up as Entities in PVA. 
    2. When I create Topics, Sub-Topics and Inquiry Types in Power Automate (Power Virtual Agent section where you create the variables) I can only see them in Power Automate Dynamics Content if I am selecting a fields that isn't an Option Set in CDS. These are Option Sets in CDS, not text fields. 😞
    3. When you use the following variables, are these the same name as the variables in PVA? I am not seeing the relationship between the variables defined in Power Automate (Power Virtual Agent section where you create the variables) and the Dynamics Content? I guess I expected the Dynamics Content to be populated with the variables defined from PVA?

    Date - string

    Title - string

    Type - string

  • renatoromao Profile Picture
    renatoromao 6,762 on at
    Re: Beginner Help - PVA to Create new record in Custom Entity from PVA Variables

    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}

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 137,998

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics