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 / Powerapps patching mul...
Power Apps
Unanswered

Powerapps patching multiple dataverse tables for new and existing records

(0) ShareShare
ReportReport
Posted on by 280

I am new to powerapps and have a query. How to add NEW and UPDATE existing customers and it's devices, task details. I am using multiple Dataverse tables for Customer and it's associated devices and tasks associated to those devices. If someone can explain with a sample code it will be really helpful.

 

For example, I have below tables;

 

Customer - Master - CustomerID as PK

Devices - Detail - DeviceID as PK and Lookup column as CustomerID

Tasks Table - Detail - TaskID as PK

Task Status - Detail - TaskStatus as PK, Lookup column as DeviceID and TaskID

I have the same question (0)
  • Devikumari Krishna Profile Picture
    988 Super User 2024 Season 1 on at

    Hi @rohitsbots ,

     

    You can use Microsoft flow. DataVerse connectors can help you achieve this. You can use the trigger when a record is added, modified or deleted and in next step call Add Row and map to respective child entity record that you want to create. In your case tasks and devices. (refer sample screen shot below)

     

    The same connector also offers you Change Type ->Modified. When an Account is modified get all the child records in List control within flows. Apply to each record the change you want to map if there is any from the parent record.

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    My Blog: Dynamics 365 Key Topics – https://d365topicsbydk.com/
    My Youtube Channel : https://www.youtube.com/channel/UCxSIryP2ah2VpEFr-Z72t1A

     

     

    DeviKrishna_0-1637835115137.png

     

    Regards

    Devi

  • rohitsbots Profile Picture
    280 on at

    Is flow the only option ? We are preferring not to use flow instead we are trying to write all the code in the powerapps itself. Like using Patch, Add columns, Filter etc to achieve this. I am looking for a sample example using that.

  • rohitsbots Profile Picture
    280 on at

    Any help is really appreciated.

  • Ram Prakash Duraisamy Profile Picture
    5,580 Super User 2025 Season 2 on at

    Hello @rohitsbots,

     

    You can try below code

     

    For Creating new records you can try 

     

    Patch(customerTable,Defaults(customerTable),{columnFromCustomerTable: Valueforthistable)

     

    Same way for other table as well,

     

    If you want to Update you can try

     

    Patch(	CustomerTable,
     	LookUp(CustomerTable,ID = customerTableGuid),
     	{
     	CustomerTableColumnName: CustomerTableValue
     	}
    	)

     

    Devices - Detail - DeviceID as PK and Lookup column as CustomerID

     

     

    Patch(Devices,
    LookUp(Devices,ID = DevicesTableGuid),
    {
    DevicesTableColumnName: DevicesTableValue
    CustomerID = Lookup(customers,ID=CustomersGUID)
    }
    )

     

    Task Status - Detail - TaskStatus as PK, Lookup column as DeviceID and TaskID

     

    Patch(TaskStaus,
    LookUp(TaskStaus,ID = TaskStausTableGuid),
    {
    TaskStausTableColumnName: TaskStausTableValue
    TaskID = Lookup(Tasks,ID=TaskGUID),
    DeviceID = Lookup(Devices,ID=DeviceID)
    }
    )

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

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 840 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 332 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 275

Last 30 days Overall leaderboard