Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • v-bofeng-msft Profile Picture
    on at
    Re: After Patch Focus on record in another form

    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

  • Sn3l Profile Picture
    on at
    Re: After Patch Focus on record in another form

    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
    Re: After Patch Focus on record in another form

    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
    Re: After Patch Focus on record in another form

    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
    Re: After Patch Focus on record in another form

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard