cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dan_Ryan_
Level: Powered On

Updating child status fields

Hi all,

 

After 3 hours of solid searching + trial and error attempts, I've finally given in and come on here to ask a question. Great forum by the way. 

 

I'm building a Project cost app, which is currently using Excel for datasources:

I have a list of unique projects in a Project Table, and each has an assigned Status; Draft, Submitted, Approved. 

 

And each project has a Cost section where you can allocate a number of cost items to each project. These elements are held in a Cost_table. These link to the Projects using a project_ID field.

 

What I'm hoping to do is update a field in the Cost_table called Status which gets updated whenever the Project Status gets updated, but despite lots of attempts with the Patch / ForAll commands I've had limited sucess. 

I managed to get it to update one record, but it didn't do all of them. 

 

This is what I used to get one record updated:

CTC is a collection of the Cost_table

Gallery1 is displaying the Project Table

ForALL(CTC,Patch(Cost_table,Lookup(CTC, Project_ID=Gallery1.Selected.Project__ID),{Status:Status}))

 

All help greatly appreciated.

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Updating child status fields

@Dan_Ryan_ 

 

You might consider using the UpdateIf function for this operation.

 

UpdateIf(CTC, Project_ID=Gallery1.Selected.Project__ID, {Status: yourStatus})

 

This will update all records that match that criteria of the ProjectID.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Updating child status fields

@Dan_Ryan_ 

 

You might consider using the UpdateIf function for this operation.

 

UpdateIf(CTC, Project_ID=Gallery1.Selected.Project__ID, {Status: yourStatus})

 

This will update all records that match that criteria of the ProjectID.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Dan_Ryan_
Level: Powered On

Re: Updating child status fields

Why thank you sir. That worked perfectly!

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,201)