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 Apps / multiple records updat...
Power Apps
Unanswered

multiple records update for CDS entity

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi ,

I am trying to update multiple  CDS entity record using ForAll and Path and Lookup function.

I also tried with path function but its showing "Invalid argument type error"
Same code is working with SharePoint list but not with CDS entity.


Used below code updateif (Fuction):-
ForAll(ReassignUserCollection6,UpdateIf(ChemicalOrders,ChemicalOrderID="1", {OrderNumber:"order1"}))

used below code with Patch function:-
ForAll([RenameColumns(Filter(ReassignUserCollection6,IsChoosen=true),"crb05_chemical_id","crb05_chemical_id_new")], Patch(ChemicalOrders,LookUp(ChemicalOrders,Chemical_ID=crb05_chemical_id_new),{ OwnerID: "1"}))


Regards,
Lalit Kadam

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Modify the code:

    ForAll([RenameColumns(Filter(ReassignUserCollection6,IsChoosen=true),"crb05_chemical_id","crb05_chemical_id_new")], Patch(ChemicalOrders,LookUp(ChemicalOrders,Chemical_ID=crb05_chemical_id_new),{ OwnerID: "1"}))

    to

    ForAll(RenameColumns(Filter(ReassignUserCollection6,IsChoosen=true),"crb05_chemical_id","crb05_chemical_id_new"), Patch(ChemicalOrders,LookUp(ChemicalOrders,'Chemical_ID'='crb05_chemical_id_new'),{ OwnerID: "1"}))

    Or 

    UpdateIf( ChemicalOrders, 'Chemical_ID' in ReassignUserCollection6.'crb05_chemical_id', { OwnerID: "1"})

     

    Hope this helps.

    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Sik,

     

    Thanks  for quick reply.

     

    I tried both code but it is still showing same error again. Please refer attached screen shot.

    Regards,

    Lalit Kadam

    Invalid_Argument_type_error.png
    Invalid_Argument_type_error_1.png
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    The error shows the entity name ChemicalOrders is invalid.

    Please check it in the left Data source panel.

    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Sik,

     

    The "chemicalOrders" entity is exists. Please find attached screen shot.

    Regards,

    Lalit Kadam

    Invalid_Argument_type_error_2.png
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    There is no need to use ForAll function. Just try to use UpdateIf function alone.

     

    UpdateIf( ChemicalOrders, 'Chemical_ID' in ReassignUserCollection6.'crb05_chemical_id', { OwnerID: "1"})

    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi sik,

    I have to update selected record from gallery. updateif function only updating single record from selected list. therefore I am trying with ForAll function.

    Regards,

    Lalit Kadam

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I don't agree with you.

    UpdateIf function can modify one or more records that match the condition ( 'Chemical_ID' in ReassignUserCollection6.'crb05_chemical_id')

    Please check: UpdateIf function 

     

    Sik

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard