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

Couldn't write my MasterID

I tried to patch my repeating table and for submit i wrote this onSelect submit button. 

 

Patch('Travel Request', Defaults('Travel Request'),RequestForm.Updates,RequestForm_1.Updates); Navigate('Thank you',ScreenTransition.Cover);
ForAll(TravelCollection, If(!IsBlank(LineItem), Patch(TravelDetail, Defaults(TravelDetail), {Title:LineItem, EstimatedCost:LineCost, Remark:LineRemark, MasterID:RequestForm_1.LastSubmit.ID})));

 

All is good, but it just doesn't read my LastSubmit.ID and when passed to sharepoint, the MasterID field is empty.  😭

 

Thank you so much 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@N_Aainism  LastSubmit.ID will be available only when you use the SubmitForm() function. If you use Patch, use the return value to capture the patched record. Try this,

Set(varPatchedRecord, Patch('Travel Request', Defaults('Travel Request'),RequestForm.Updates,RequestForm_1.Updates));
ForAll(TravelCollection, If(!IsBlank(LineItem), Patch(TravelDetail, Defaults(TravelDetail), {Title:LineItem, EstimatedCost:LineCost, Remark:LineRemark, MasterID:varPatchedRecord.ID})));

 

 

View solution in original post

3 REPLIES 3
CNT
Super User
Super User

@N_Aainism  LastSubmit.ID will be available only when you use the SubmitForm() function. If you use Patch, use the return value to capture the patched record. Try this,

Set(varPatchedRecord, Patch('Travel Request', Defaults('Travel Request'),RequestForm.Updates,RequestForm_1.Updates));
ForAll(TravelCollection, If(!IsBlank(LineItem), Patch(TravelDetail, Defaults(TravelDetail), {Title:LineItem, EstimatedCost:LineCost, Remark:LineRemark, MasterID:varPatchedRecord.ID})));

 

 

N_Aainism
Regular Visitor

You are a life saver! It works like magic. Thank you so much!

May you have a wonderful life 🙂 

@N_Aainism Glad to help!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,129)