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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Fail to set a new Data...
Power Automate
Answered

Fail to set a new DataTable using the current item FOR EACH got

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi community,

 

Would you please help me with below question? Thanks in advance.

 

There is the datatable "TestExcelData" which is from reading from my excel worksheet.

on99username_0-1640845428997.png

on99username_1-1640855047126.png

 

And then I created new blank datable with static header like below.

on99username_0-1640855144127.png

 

on99username_1-1640855198318.png

Then I will use For-each action to loop the "TestExcelData" the first datatable and  use condition to identify if the current item is target or not.

on99username_2-1640855609241.png

 

What i want to do is to add this current item into my new blank table just created If the result is True. Can I use the Set variable to do this? Please give me a hand on this. Thanks!

 

 

 

 

 

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Here is the website for the syntax:

     

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types

     

    here is a screenshot excerpt:

     

    5E789690-24DA-42C8-9489-E2C5E2918F7B.png

    following the protocol here, you should be able to add a row.

     

    it should be like this:

     

    ADF640DB-9247-474B-8A78-93AAE0A6BFFF.jpeg

    If you are still having trouble, so two things for me. 1) screenshot the inside of your last Set variable, so I can see where the % marks are, and 

    2) Set clipboard text exactly how you set variable, so we can see what the output is.  It’s possible that we are just missing a [] or {}.

     

    good luck!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi MichaelAnnis

    Hope you are doing well and thanks for your reply!

     

    Yes, Actually I have learned that way you just shared to add the value into datatable. But the value must be hard code like ['Product3', '30 USD']. 

     

    And what I want to do actually is how to use the current item to add into a datatable instead of using the static value.

     

    I have tried below to do, but still failed.. Any idea?

     

    on99username_0-1640858821619.png

     

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    Yeah…do this:

     

    %DataTable + CurrentItem2%

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It works!

    Really hope that Microsoft should add this session into learning doc.

    Thanks MichaelAnnis!

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    It’s kind of there. It is just tricky and very subtle. 

    notice in my second screenshot in my first post…

     

    it is not %Products% + …

     

    it is %Products + (then new datarow as text) %

     

    so, in your case, CurrentItem replaces new datarow, and you are able to add the datarow to the existing table. 

    glad I could 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 273 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 235

#3
David_MA Profile Picture

David_MA 172 Super User 2026 Season 2

Last 30 days Overall leaderboard