web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / After Patch Focus on r...
Power Apps
Unanswered

After Patch Focus on record in another form

(0) ShareShare
ReportReport
Posted on by

Good Morning

 

I am currently patching a recording and after the patch I created a variable to show the fields visible to edit the new record.  For some reason my patch returns the first value in my list and not the new one i just created. 

 

Patch('Suggested Travel',Defaults('Suggested Travel'),
 {BookingRef: {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id: DataCardValue9.Selected.Id,
 Value: DataCardValue9.Selected.Value
 }
 }
 
 );Notify("New Suggestion has been created, Please complete and submit",NotificationType.Success,5000);
 
 

 Set(ShowFields,true)

Is there a way this can be achieved. 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @Sn3l ,

     

    Could you please tell me:

    • How did you set that variable? The formula you provide involves only one Boolean type variable.

     

    In addition, can you check if this patch is working properly and if the required fields are missing?

     

    Finally , you could use this formula to save the patch record:

    Set(VariableName,Patch(XXX))

     

    Best Regards,
    Bof

  • Sn3l Profile Picture
    on at

    Hi Bof

     

    Thank you very much for the response. 

     

    Onselect on my New Suggestion button, Creates a new record (highlighted in Yellow) and Sets my Form Visible (highlighted in blue) allow the user to complete and submit.  

     

    I tried the below listed by adding the varRef. (DataCardValue9 is a lookup Field).  Not to sure if this is correct. 

     

    It Creates the record Perfect. but as you would notice is it still shows the first field in the form 

    Set(VarRef,DataCardValue9);
    
    Patch('Suggested Travel',Defaults('Suggested Travel'),
     {BookingRef: {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: DataCardValue9.Selected.Id,
     Value: DataCardValue9.Selected.Value
     }
     }
     
     );Notify("New Suggestion has been created, Please complete and submit",NotificationType.Success,5000);
     
    
     Set(ShowFields,true)

     

    Sn3l_1-1667436996549.png

     

     

  • v-bofeng-msft Profile Picture
    on at

    Hi @Sn3l ,

     

    Could you please tell me what the form's item property is?

     

    Where is the DataCardValue9? It seem to be a control,  what is it's items proerty?

     

    Best Regards,

    Bof

     

  • Sn3l Profile Picture
    on at

    The form is called ChangesForm. 

     

    Item Properties 

    LookUp('Suggested Travel', ID = ChangesTable.Selected.ID)

     

    The reason I set it to this is so that when the users clicks on the above galleryTable "changesTable" it could reflect the record.

     

    Sn3l_0-1667439875061.png

     

    Should I possibly put an IF statement on this item. 

     

     

  • v-bofeng-msft Profile Picture
    on at

    Hi @Sn3l ,

     

    When you create a new record, the ChangesTable will not automatically select this record, so the form command displays the record selected by the ChangesTable by default. You can consider adding an IF judgment to display a new record if there is a new record submitted.

     

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard