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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching a new record ...
Power Apps
Answered

Patching a new record without Lastsubmit

(0) ShareShare
ReportReport
Posted on by 7

Hi guys,

I've been trawling for solutions and trying to repurpose for my needs, but I can't seem to wrap my head around it.

 

I'm creating an app that walks colleagues through a process. Each step of the process requires a long bit of text to explain to the user.

After each step (a new screen for each!) I am looking to have a checkbox that shows that the stage was complete. This will be linked to a sharepoint list that stores the yes/no of the completion of each stage.

I have a gallery set up that allows people to pick up another day where they've left off or for another colleague to pick up the task.

 

The issue is that I need to be able to reference the record they've selected OR the new record they've created.

 

I.E: Gallery item is selected and navigates to check list start. OR

"Start new" is selected which then navigates to an ID creation page then onto the check list.

 

I've tried using Patch  OnCheck function to create the Yes in the list.

 

This works for Gallery selected items because of the Gallery.selected ID.

It doesn't work for newly created items as there is no ID set. I can create the new record using Patch with Defaults(mylist) but this doesn't then allow me to reference the record just created to assign the Checkboxes to.

 

I want to avoid using Edit Forms as I want to use it across multiple pages and use checkboxes instead of toggles for the I/O on completion. Perhaps I can have an invisible screen with the full form on and use the checkbox to trigger the toggle, navigate and submit the form so it saves at each stage, but I don't know how to program the checkbox triggering of the toggle.

 

Any help would be appreciated.

Categories:
I have the same question (0)
  • timl Profile Picture
    37,212 Super User 2026 Season 1 on at

    Hi @Mr-E 

    In the situation where you're creating a new record, the Patch function returns the new record.

    You can assign the return value from Patch to a variable like so.

    Set(MyRecord,
     Patch(MyDataSource,Defaults(MyDataSource),{Name: 'Tim'})
    )

    After the call to Patch, you can then retrieve the ID value of your new record by calling MyRecord.ID

    Hopefully, that'll give you enough to progress the feature that you're building.

  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @Mr-E ,

     

    May I know the reason why you cannot get the ID of the newly created items using Defaults(mylist)? Did you mean that you want to get the ID in the same formula of "Patch(List,Defaults(List),...)" formula? 

     

    Regards,

    Mona

  • Mr-E Profile Picture
    7 on at
    Hi both, thanks for your input.
    I definitely explained this badly.

    So screen1 is my gallery
    Screen 1.5 is a new start screen
    Screen2 (and beyond) is the checklist.

    Screen 1 allows users to continue/edit a previously created record (gallery select, skip straight to screen 2) or start a new record (go to screen 1.5 and input new record title).

    Screen 1.5 asks users for the title to create the new record using defaults(mylist), which works. Then continue to screen2

    Screen 2+ has a checkbox that I would like to update either the continued or newly created record.

    I’m falling down with the checkbox patch function at the “record” input. I can have this use gallery.selected from screen1 just fine, but I don’t understand how I could make this reference the gallery.selected or be a continuation from 1.5 and retain that new record ID.

    I have tried having the gallery onselect and screen 1.5 button create a global variation, but when referencing that as the patch record it kicks this back as being Text instead of Record.
  • Delid4ve Profile Picture
    795 on at

    Hi @Mr-E 

    I've not read your post deeply but it seems you have a similar situation to what i had.

     

    To solve the issue of no ID for new records i added another column of type GUID.  This way using the GUID() function new records can have a unique identifier which will be present on ALL records whether they have an ID or not.

     

    For instance my app uses offline data so I dont get the ID straight away.  However other collections i used needed to refer to this item by an identifier, this is where the GUID cam in so i could link them this way.

     

    Hope this helps

  • Verified answer
    timl Profile Picture
    37,212 Super User 2026 Season 1 on at

    Hi @Mr-E 

    Thanks for the clarification. This is how I would do this.
    To navigate from screen1 to screen2 (in the case of an existing record), you would set the variable value before navigating to screen2. In the OnSelect property of your gallery control, you would use the following formula.

    Set(MyRecord, Gallery1.Selected);
    Navigate(Screen2)


    On screen 1.5 (where you're creating a new record), you would use the formula in my earlier post.

    Set(MyRecord,
     Patch(MyDataSource,Defaults(MyDataSource),{Name: 'Tim'})
    )
    


    On screens 2+ (where you're updating a record), you would Patch the variable, rather than Gallery.Selected. That way, you'll be patching either an existing or new record, depending on how the user arrived at screens 2+

    Patch(MyDataSource,MyRecord,{CheckboxValue: CheckboxControl.Checked})

     

    Hope that makes a bit more sense.

  • Mr-E Profile Picture
    7 on at
    I tweaked it a little bit to use the oncheck and onuncheck, but this works fantastically, thank you! I wonder why when I tried setting a variable and using that as the reference it rejected as text instead of a record. I won’t get caught up on that! It works, that’s what matters!
  • timl Profile Picture
    37,212 Super User 2026 Season 1 on at

    Glad you've got this to work @Mr-E 

    Thanks for the tip about using GUID to create unique identifiers @Delid4ve

  • Delid4ve Profile Picture
    795 on at

    @timl having read the post now i see it doesn't apply here but when your using offline data it becomes very useful when you need to relate table data 👍

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard