cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Imitating rollup field functionality

Objective

I'm trying to build a flow that will imitate the rollup field functionality. 

 

Structure

One entity named Trackers

One entity named Details

One to many from Trackers to Details(multiple details records can be connected to a single Tracker record)

On the Trackers form, I have a subgrid that includes the related Details records

 

Difficulties

I have the functionality working on creation and update of a Details record. Any time those events happen, a flow fires to recalculate the imitation roll up fields, and then writes back to the Tracker record with those values.

 

The problem is one deletion of a Details record, I no longer have the records info so I can't do a lookup to its parent. 

 

How would you achieve this?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Imitating rollup field functionality

Hi @notj 

 

There is a flow trigger called W'hen a record is deleted' but this only returns the Id (GUID) of the record which is already deleted. You could achieve this via adding a delete flag (new field - boolean type) in details record. Once the flag is set to true then trigger the flow check the flag is true then recalculate the values and finally delete the details record via Flow.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Highlighted
Post Patron
Post Patron

Re: Imitating rollup field functionality

@abm Is this basically what the Deactivate button does? If so, I guess I could just use that to imitate deleting an item right?

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Imitating rollup field functionality

Hi @notj 

 

There is a flow trigger called W'hen a record is deleted' but this only returns the Id (GUID) of the record which is already deleted. You could achieve this via adding a delete flag (new field - boolean type) in details record. Once the flag is set to true then trigger the flow check the flag is true then recalculate the values and finally delete the details record via Flow.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Highlighted
Community Support
Community Support

Re: Imitating rollup field functionality

Hi @notj ,

 

Please take a try with @abm 's suggestion.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Highlighted
Post Patron
Post Patron

Re: Imitating rollup field functionality

@abm I'm confused how you would set a field on a deleted item after it's been deleted. As you said, once it's deleted all you have is the GUID.

Highlighted
Super User III
Super User III

Re: Imitating rollup field functionality

No what I was suggesting is instead deleting from the user interface users will mark it as ready for delete by setting the flag. Then flow will pick this up and delete via Flow.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Post Patron
Post Patron

Re: Imitating rollup field functionality

@abm Is this basically what the Deactivate button does? If so, I guess I could just use that to imitate deleting an item right?

View solution in original post

Highlighted
Super User III
Super User III

Re: Imitating rollup field functionality

Hi @notj 

 

Yes that's another option. You can ask users to deactivate the records. Once the record is deactivated flow can run the relevant business logic (recalculate etc) then delete the actual record via flow.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Post Patron
Post Patron

Re: Imitating rollup field functionality

@abm when trying to target only active, I'm getting an error.

 

Here's my filter:
_cr5be_facility_value eq '@{triggerOutputs()?['body/_cr5be_facility_value']}' and _statuscode_label eq 'Active'

The error tells me that _statuscode_label doesn't exist though.

 

I composed the value, and I get all the expected fields as well as this:
"_statuscode_label": "Inactive",

Highlighted
Post Patron
Post Patron

Re: Imitating rollup field functionality

Nevermind. I just targeted the Statuscode field instead of the value of the label.

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (3,974)