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 Apps / How to Update All Data...
Power Apps
Answered

How to Update All Data Rows in DataTable and Data Table is inside DataCard

(0) ShareShare
ReportReport
Posted on by 34
Hi, I use Data Table inside Data Card.
and I'd like to save all item from data table to sharepoint list by using data card Update function.
but I can't use ForAll.
 
This picture is example.
I try with this fomular but it's not work.
ForAll(colData,
Patch(
    tbl_detailActivities,
    LookUp(
        tbl_detailActivities,
        activityNo=DataCardValue17.Text
    ),
    {
        DataSubjectRights: tbl_dataRight.Selected.legalBasisDesc
    }
)
)
Thank you in advance for any suggestion.
I have the same question (0)
  • Verified answer
    vipuljain03 Profile Picture
    657 Super User 2025 Season 2 on at
    You're facing an issue because the Update property of a DataCard is meant to return a single record, not multiple records. Since ForAll performs a loop to patch multiple records, it doesn't work inside Update.
     
    Solution Approach (recommended):
    Instead of trying to use ForAll inside the DataCard's Update property, handle the save operation outside the form submission process using a button's OnSelect property. You can use ForAll inside a button's OnSelect event like below:
    ForAll(
        colData,
        Patch(
            tbl_detailActivities,
            Defaults(tbl_detailActivities), // If adding new records
            {
                activityNo: DataCardValue17.Text,
                DataSubjectRights: tbl_dataRight.Selected.legalBasisDesc
            }
        )
    );
    ➡️This code will loop through colData and create a new record in tbl_detailActivities for each item.
     
    In case, you need to use the Update property of the Datacard, try concatenating the values into a single text field and then splitting it back in Power Automate when saving to SharePoint. But this approach requires additional handling in Power Automate to split and store the data properly.
    Concat(colData, activityNo & "|" & tbl_dataRight.Selected.legalBasisDesc & ";")
    ---------------------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
     
    Thanks,
    Vipul
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at
    Hi,
     
    Are you expecting to create a new Record or update ?
     
    If it is create use Defaults(tableName) instead of Lookup

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard