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

Updating Column in Entity without a form

Hi There,

 

I'm currently having trouble with something I thought was relatively straight forward at first.

 

I'm using the Common Data Service entities with no other external data sources, what I currently have is a Course entity and a Course Information entity. I have a column in the Course entity which is a LookUp to a Course Information entity. What I want to do is have the ability to create a new Course Information entity and link it back to the Course.

 

So I have an option for the user to choose a Course from a list of all Courses, when they choose a Course and want to add Course Information I want them to fill out a form with the Course Information, add it to the Course Information data and then link that newly created Course Information entity back to the Course which was selected.

 

Apologies if the explanation is long-winded, or if it's a very easy thing to do. Been stuck, tried number of different things including hidden forms that trigger to update old entities but can't seem to crack it.

 

 

Cheers,

Dean.

 

Short Version: I want to be able to update a LookUp column in an already existing entity to reference a newly created Entity as soon as the new Entity is created.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
DeanH
Level: Powered On

Re: Updating Column in Entity without a form

Hi aandrade,

 

Of course that'd be no problem, I basically used the information on this page here: https://powerapps.microsoft.com/en-us/tutorials/function-patch/

 

It allowed me to write a quick formula that let me update a column in a specific row. I used the example "Patch( IceCream,
First( Filter( IceCream, Flavor = "Chocolate" ) ), { Quantity: 400 } )" 
as guidance. It basically lets you Patch a Collection choose the row with the First(Filter so what the function will does is finds the first row within the IceCream collection with the flavor of Chocolate and then changes it's Quantity value to 400.

 

So, Patch(YourCollection, First(Filter(YourCollection, Condition)), {ColumnToUpdate: ValueToAssign}) is how it breaks down.

 

I was able to use that to basically specify my LookUp column to point to the entire row it looks up in the other Entity.

 

I really hope this helps!

 

Cheers,

Dean.

View solution in original post

3 REPLIES 3
DeanH
Level: Powered On

Re: Updating Column in Entity without a form

Ignore this entire post in terms of the question.

 

Just finally found the Patch function which was the answer to all my questions!!

 

I feel very silly that it took so long to figure it out Smiley Frustrated

 

Apologies for the pointless thread now.

aandrade
Level: Powered On

Re: Updating Column in Entity without a form

Hi DeanH,

 

Could you be more specific as to how you used the patch function to link to your entity? Are you able to update it?

 

I'm also stuck on saving the data that I've collected on the app to my entity.

 

Your guidance is appreciated!

Highlighted
DeanH
Level: Powered On

Re: Updating Column in Entity without a form

Hi aandrade,

 

Of course that'd be no problem, I basically used the information on this page here: https://powerapps.microsoft.com/en-us/tutorials/function-patch/

 

It allowed me to write a quick formula that let me update a column in a specific row. I used the example "Patch( IceCream,
First( Filter( IceCream, Flavor = "Chocolate" ) ), { Quantity: 400 } )" 
as guidance. It basically lets you Patch a Collection choose the row with the First(Filter so what the function will does is finds the first row within the IceCream collection with the flavor of Chocolate and then changes it's Quantity value to 400.

 

So, Patch(YourCollection, First(Filter(YourCollection, Condition)), {ColumnToUpdate: ValueToAssign}) is how it breaks down.

 

I was able to use that to basically specify my LookUp column to point to the entire row it looks up in the other Entity.

 

I really hope this helps!

 

Cheers,

Dean.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 428 members 5,802 guests
Recent signins:
Please welcome our newest community members: