cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Work instructions: how to structure common work steps?

Scenario:

Using CDS as the data source for work instructions for many assemblies. Some assemblies have identical steps. For these identical steps I want to be able to edit them as needed in one entity record and have it feed all the places where that record is being used.

 

Intuitively I think something like this should work: 

 

EntityMany has columns: ID, Common? (two OptionSet), and Text

EntityOne has ID, and Text

 

If entityMany.Common = true, EntityMany.Text = LookUp(EntityOne, ID = EntityMany.ID).Text

 

So EntityOne would hold the common steps. I've been trying to figure out how to do this with relationships and business rules because I need this to happen at the datasource not the app. I'm pretty sure that this sort of functionality is what CDS is made for so I'm hoping someone can point me toward a resource where something like this is explained. I've read the documentation and watched a few videos already but I really just want to get this done quickly instead of figuring it out all day. Help is very much appreciated. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Work instructions: how to structure common work steps?

Hi @Anonymous ,

Do you want to update an entity based on another entity's value by using business rule?

I'm afraid it's not supported to set a business rule based on two entities.

Business rules are usually defined for an entity and apply to all forms.

Business rules are server-side logic that is used with canvas or model-driven apps to set or clear values in one or many fields in an entity.

For example, you create business rule in entity1, then you can not choose entity2 when you define the business rule.

As an alternative way, I suggest you update data in powerapps.

In an app, you could connect with multiple entities.

Try this formula to update:

ClearCollect(filtereddata,Filter(EntityMany,common='common (EntityMany)'.'true'));

ForAll(filtereddata,Patch(EntityOne,LookUp(EntityOne,ID=filtereddata[@ID]),{Text field:filtereddata[@Text field]}))

Then all the text field in entityone will be updated with the value of Text field in entitymany.

 

Here's a doc about updating multiple records for your reference:

https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/

 

 

Best regards,

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

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Work instructions: how to structure common work steps?

Hi @Anonymous ,

Do you want to update an entity based on another entity's value by using business rule?

I'm afraid it's not supported to set a business rule based on two entities.

Business rules are usually defined for an entity and apply to all forms.

Business rules are server-side logic that is used with canvas or model-driven apps to set or clear values in one or many fields in an entity.

For example, you create business rule in entity1, then you can not choose entity2 when you define the business rule.

As an alternative way, I suggest you update data in powerapps.

In an app, you could connect with multiple entities.

Try this formula to update:

ClearCollect(filtereddata,Filter(EntityMany,common='common (EntityMany)'.'true'));

ForAll(filtereddata,Patch(EntityOne,LookUp(EntityOne,ID=filtereddata[@ID]),{Text field:filtereddata[@Text field]}))

Then all the text field in entityone will be updated with the value of Text field in entitymany.

 

Here's a doc about updating multiple records for your reference:

https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/

 

 

Best regards,

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

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,698)