web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dataverse Add a New Ro...
Power Automate
Unanswered

Dataverse Add a New Row action from an Excel table, dynamic content is not possible for Choice columns

(0) ShareShare
ReportReport
Posted on by 9

I am building a flow that 1) Lists rows from a table in Excel,  2) for each row, Add a row in a Dataverse table.

However, the data output from "List rows present in a table" cannot be added to the Choice column on the Dataverse.

In the screenshot the Choice fields have a dropdown to select the choice, however, I need to add the dynamic content from the output of the 'List rows' step.

 

How can I "Enter a Custom Value" using the dynamic content from the List Rows Present in a Table output?

 

Mchallinor_0-1700654697429.png

Additional Information.


The data output from the "List Rows Present in a Table" step contains the text/name of the choice in the Dataverse.
But I'm now assuming that for the "Add new row" step in Dataverse I'll need the Value (enum) of the choice to add it.

Taking a peek at the code, I see that it would look something like :
"item/ms_itemstatus": 100000001
I'm not sure of a custom expression that I could use?   (Perhaps an 'if statement').

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    If the choices in Dataverse weren't going to change, I'd probably just add a mapping object in the flow where you could use the name from Excel and return the Id of the Choice required for Dataverse. See an example below.

     

    I have the following Excel Table.

    grantjenkins_0-1700667206044.png

     

    And the following Dataverse Table.

    grantjenkins_1-1700667275886.png

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_2-1700667309212.png

     

    Colors is a Compose that is my mapping table with the name of the color and the Id in Dataverse.

    {
     "Red": 1,
     "Green": 2,
     "Blue": 3
    }

    grantjenkins_3-1700667363397.png

     

    List rows present in a table retrieves my rows from Excel.

    grantjenkins_4-1700667396402.png

     

    Apply to each iterates over each of the rows.

    grantjenkins_5-1700667421813.png

     

    Add a new row uses the following expression to map the color name to Id.

    outputs('Colors')?[item()?['Color']]

    grantjenkins_6-1700667469723.png

     

    After running my flow, I should have my new rows added.

    grantjenkins_7-1700667510054.png

  • Mchallinor Profile Picture
    9 on at

    Hi Grant,


    Thanks for your help.  That has achieved exactly what I needed.

     

    FYI,  I worked on a different method that also worked.

    First, initialise a string variable before "apply to each row" 
    Then during the "apply to each row" Set the string variable with the outputs from the Excel table.

     

    Using your Name and Color example it would have looked something like this:

    Mchallinor_1-1700677204438.png

     

    Then when adding the row to the Dataverse, for the Choice column, you can use an If Statement like this:
    if(equals(variables('strColor'),'Red'),string(1),if(equals(variables('strColor'),'Green'),string(2),if(equals(variables('strColor'),'Blue'),string(3),string(0))))

    Mchallinor_2-1700677539332.png

     

    But I accept your solution is cleaner and easier to maintain the array of colors (in the compose step) than having to edit the custom expression.  The If Statement is ugly in my solution.

     

    Many thanks for your help.

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard