cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
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
Highlighted
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

Highlighted
Regular Visitor

Re: Updating child status fields

Why thank you sir. That worked perfectly!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,188)