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.
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 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!
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?
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. :)
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? 😉
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.
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 😉
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?
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...
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!
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
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? 🤔
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.
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.
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 😜
@@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!
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.
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.
Awesome. Happy to help 🤩
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.
Happy to help. Have a great day. 🐶
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.
Great to hear! I had been watching you so I knew what you needed. 😉
@@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!
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 💥💥
You're welcome! I can't imagine why you don't trust those users. 🤣
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?
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. :)
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? 😉
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.
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 😉
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?
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...
Thank you for this new learning Shane!! number one fan here.
Great videos Shane! Do you know how to turn the Comments off when using the Edit mode in PowerApps?
I don't, I have never tried. 🤔
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!
Preview. 😎 I still don't think they are ready for primetime as a whole, so I continue to use Classic.
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
Interesting and good to know. Thanks. I had no idea, I have cursed that field for years. 🤩
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? 🤔
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.
@@ShanesCows You are right, would be a slow and annoying experience for the user. Thank you very much! 😃
Thank you Shane
Happy to help. 🐶
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.
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 😜
@@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!
Great video - thanks Shane.
Very welcome
Simple and clever!
Thanks 🤩
Great video, thanks
Glad you liked it!
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.
Is it possible to restrict users so they can only see records that they created and not all records.
Yes filter the gallery to created by = user