Save as Draft in Power Apps

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 42

  • @kevinbriz17
    @kevinbriz17 6 หลายเดือนก่อน +4

    Set varrecord as a prefix to patch! Why didn't I think of that! I'm going to be updating lots apps today. Thanks, Shane.

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Awesome. Happy to help 🤩

  • @gorky_fr
    @gorky_fr 7 หลายเดือนก่อน +1

    I have been working on something like this since 3 days now and I was stucked like hell! And than; Shane came to help. Thanks man, this helped me more than you think.

    • @ShanesCows
      @ShanesCows  7 หลายเดือนก่อน +1

      Great to hear! I had been watching you so I knew what you needed. 😉

    • @gorky_fr
      @gorky_fr 2 หลายเดือนก่อน

      @@ShanesCows At exactly 4'46" can you explain what you did? As i copy your moves according to my DB table and columns etc., I messed up this step! A little detailed explanation should be enough! Thanks in advance!

  • @spen2431
    @spen2431 7 หลายเดือนก่อน +2

    Nice one. Been using that method for a while. I just don't trust end users to click a "Save as draft" button :) Thanks for sharing Shane 💥💥

    • @ShanesCows
      @ShanesCows  7 หลายเดือนก่อน +2

      You're welcome! I can't imagine why you don't trust those users. 🤣

  • @TheFashionWHT
    @TheFashionWHT 6 หลายเดือนก่อน +1

    My manager had been asking for this feature for our app, but since I was new to PowerApps, I wasn’t sure how to do it. Even put IT team highly advised not adding that feature to the already complex app I was designing. Wish I had seen this video beforehand haha this looks way easier than what I was creating.

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Happy to help. Have a great day. 🐶

  • @chalmercanizares42
    @chalmercanizares42 6 หลายเดือนก่อน

    Thank you for this new learning Shane!! number one fan here.

  • @tomaszturek6998
    @tomaszturek6998 6 หลายเดือนก่อน +1

    Thanks for the great piece of knowledge Shane!
    I have three questions though:
    1. Can I use a SP list as a source?
    2. Must I format the Status column to multiple choices? Or could I patch data as a Txt ("Draft", "Submitted ", ...)
    3. The reason for 1. and 2. is that my gallery shows only the last record (even though a SP list has all the Drafts and Submitted records in). And then, after I restart Power Apps, I see a record in the gallery but when trying to open it, I'm getting into a new record screen 🤦‍♂️
    Any advice? Please? 😉

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      1 - yes. Would work the same in SharePoint
      2 - Text column would be fine. No problem just be consistent
      3- check your filter. Look for typos or something. No reason it shouldn’t work. Try manual filter. See if you can figure out why the missing records.

    • @tomaszturek6998
      @tomaszturek6998 6 หลายเดือนก่อน

      Thanks Shane. I've figured it out by watching the video over and over again 😂
      It appeared I didn't set up the variable call out in the Default setting of my input fields (text fields, drop-downs, etc.). Now it woooooork! ❤
      Thank you again, sensei 😉

    • @tomaszturek6998
      @tomaszturek6998 6 หลายเดือนก่อน

      I guess opening a champagne was a bit premature. When I open my computer, everything seems to work buuut it's not working when I Publish the app and when I change anything in filters I get a load of errors. They're all basically coming down to the variable definition and usage:
      "Incompatible type. We cant evaluate your
      formula because the context variable types are
      incompatible with the types of values in other
      places in your app"
      The var definition I have is:
      Set(varRecord, Patch('SP List', Defaults('Sp List'), {'Submission status': "Draft"}))
      Will you be able to help?

    • @tomaszturek6998
      @tomaszturek6998 6 หลายเดือนก่อน

      Ok, I've tried with another environment (basically I've re-written app completely) and it works like a charm 😊
      I'm assuming that my company's security policy may have something to do with patching funcionality...

  • @joshhammz
    @joshhammz 7 หลายเดือนก่อน +1

    Hey Shane, great video.
    Just wondering- is there any reason you haven't swapped over to using Modern controls for something like this? Maybe you're just waiting for those to come out of Preview? I'm just curious.
    Thanks!

    • @ShanesCows
      @ShanesCows  7 หลายเดือนก่อน +2

      Preview. 😎 I still don't think they are ready for primetime as a whole, so I continue to use Classic.

  • @oluwatobiyusuf
    @oluwatobiyusuf 6 หลายเดือนก่อน +2

    Thank you Shane

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Happy to help. 🐶

  • @freekimkaefig
    @freekimkaefig 2 หลายเดือนก่อน +1

    Hi Shane, I think this might be an obvious thing for most but I just started programming my first Powerapp and am having trouble with understanding the code that you put on the "new" button. In particular the definition of the status (Code: {‘status (pa911_status)’: ‘Status (Incident Management)’.Draft)}. I don't understand where the status (pa911_status) is coming from (from the data source or the power app?) and what the second part does. when I tried to adopt this to my app I always received an error message so I modified this part of the code to "{Status: {Value:"Draft"}}". What it does is create a blank entry in my data source with only the status set to draft. Will this also work or will this create issues later on? By the way many thanks for your videos, they have been helping me a lot so far.

    • @ShanesCows
      @ShanesCows  2 หลายเดือนก่อน +2

      This is My Patch
      Patch('Incident Management',Defaults('Incident Management'), {'Status (pa911_status)': 'Status (Incident Management)'.Draft})
      So in this case
      'Incident Management' is the name of the dataverse table
      Defaults('Incident Management') tells it to create a new record in the table using the table defaults
      {'Status (pa911_status)': 'Status (Incident Management)'.Draft} is the fields in the record you want to modify
      The left side of the : should always be the field (or column in the table you want to update)
      So 'Status (pa911_status)' is a field I created in my dataverse table
      That field is a choice type, a complex column type that is harder to patch
      To set the Choice to be Draft I have to use 'Status (Incident Management)'.Draft because that is how Dataverse works
      If yours is working then you are good. You are probably using a different data source type or column type. You will not have problems. I have videos on patching and patching complex if you need any recommendations.
      I hope that helps
      PS - You owe me a subscribe and a like for this massive reply 😜

    • @freekimkaefig
      @freekimkaefig 2 หลายเดือนก่อน

      @@ShanesCows thank you so much for your detailed explanation! Yes, I am using a sharepoint list, so it makes sense that this wasn't working for me.
      PS: you got the like and the sub! very much deserved!

  • @Jan-HendrikBaude
    @Jan-HendrikBaude 6 หลายเดือนก่อน +1

    Hi Shane, nice video simple trick that I will use in future ;)
    But as a Dataverse Fan Boy, Yes/No should work as expected. On column creation, by default the "No" gets Value 0 and "Yes" gets Value 1. Therefore the app understands the true false concept.
    Just did the test with a simple gallery, Patch(BooleanTests,ThisItem,{YesNoSelected:Self.Value}) in the OnSelect of a Toggle works fine, the same for setting the default of it with ThisItem.YesNoSelected.
    The label is just for display purposes and can be anything you like to make it user friendly because true/false may be harder to grasp like Yes/No, Approved/Open,... no If needed when throwing it into a label

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Interesting and good to know. Thanks. I had no idea, I have cursed that field for years. 🤩

  • @tylerbailey460
    @tylerbailey460 6 หลายเดือนก่อน +1

    Hi Shane ! Great content as always. Do you think this could be done using 2 Dataverse tables? I have a Header details table and then an Items table for a Purchase Request app. My end users would love something like this. Could I patch both tables within Var Record to achieve this?

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Yes. The Patch is a bit more complicated but will work all the same. The customer app this is based off of has a half dozen tables I am pretty sure. :)

  • @tonya3308
    @tonya3308 6 หลายเดือนก่อน +1

    Great videos Shane! Do you know how to turn the Comments off when using the Edit mode in PowerApps?

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      I don't, I have never tried. 🤔

  • @simonball5602
    @simonball5602 7 หลายเดือนก่อน +1

    Great video - thanks Shane.

    • @ShanesCows
      @ShanesCows  7 หลายเดือนก่อน

      Very welcome

  • @pabloperez-rw7df
    @pabloperez-rw7df 6 หลายเดือนก่อน +1

    Nice as always Shane! I'm a big fan of your videos and your ideas!
    I was wondering if it would be a good idea to perform the patch actions on the 'Onchange' event of each Input so you wont have to deal with the logic on the back and next buttons. Do you think this would lead to excessive patching? 🤔

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน +1

      Too many OnChanges in my opinion. If you do try it make sure you do a loading spinner while each patch happens so they don't move too fast. Which will also annoy the users but only way to make sure you don't get conflicts.

    • @pabloperez-rw7df
      @pabloperez-rw7df 6 หลายเดือนก่อน

      @@ShanesCows You are right, would be a slow and annoying experience for the user. Thank you very much! 😃

  • @karolzareba9003
    @karolzareba9003 5 หลายเดือนก่อน +1

    Simple and clever!

    • @ShanesCows
      @ShanesCows  5 หลายเดือนก่อน

      Thanks 🤩

  • @mtamitolanga
    @mtamitolanga 6 หลายเดือนก่อน +1

    Great video, thanks

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Glad you liked it!

  • @desw20
    @desw20 6 หลายเดือนก่อน +1

    Is it possible to restrict users so they can only see records that they created and not all records.

    • @ShanesCows
      @ShanesCows  6 หลายเดือนก่อน

      Yes filter the gallery to created by = user

  • @aussietvshows1702
    @aussietvshows1702 6 หลายเดือนก่อน

    The code is where I get stuck in my learning. I know what I want the controls on a page to do, just no idea how to code it.
    Maybe one day Power Apps will use a point n click interface using Rules and Conditions.