You are a life saver!!! I just spent more hours than I care to admit trying to figure this out. You have been such a tremendous help to me on so many occasions. Thank you, Shane!
Genius. Was about to spend likely 4 hours figuring out a solution to a specific problem but then wisely checked if you had cracked it already. Thank you!
When I applied the patch variable method in this video, my apps started freaking out and saying the variable now was an incompatible type. Every time I set the variable from a gallery with ThisItem, Power apps recognized it as a record type variable. When I tried to patch the record with Set(Variable, Patch(Variable... , Power Apps recognized it as an Error type, which broke everything. After a little testing, I think I found a different way to patch a variable. With this method, you aren't actually "patching" the variable, but rather resetting the variable with the updated value that was edited. the formula is: Set(Variable, Lookup(Source, UniqueIDField = Variable.UniqueIDField)) This seems to work for me and PA doesn't get all freaked out. Thanks Shane for your great videos, tips, and troubleshooting! You are a great teacher.
Thank you very much…Showing is how you troubleshoot is very helpful! As you know, we spend a LOT of time doing that. It’s good to see how others do that. Thanks!
Shane, so many good quotes in this video "it's okay to blame PowerApps" was one that made me laugh...also the one about getting out your abacus to come up with a solution. You have a gift of teaching this stuff to the frustrated and struggling. I appreciate how real you make it!
Thanks Shane! I had a similar problem when sending info to power automate where the convert file type didn't like the space. The trim function has just solved that! Life saver :)
PowerApps seems to have more difficulty with it working correctly when developing things. I too, have found something that doesn’t work and then I wait a minute, or take the code out and put it back in, or reboot it…. Then amazingly it might work! Considering it’s basically all web based and no local application, like having Visual Basic, power apps works amazingly well. I’m surprised it doesn’t have more hiccups or attitudes. I like it a lot!
Hi Shane, odd question on Patching. Can you use a variable column name in a Patch function so you can Copy/Paste the same function to all fields on an edit form? Something like onchange UpdateContext({ctxCurrentColumnName: Parent.DataField}); Patch( Data source, Record to update, {ctxCurrentColumnName: Value(Self.Text)} ); Or is this a step too far?
Love your videos Shane, it's helped me on many occasions. I have a strange issue with patch... I have used a hybrid editform and submit form and the patch function on different button selects. I select a item from a combox, I then press a button that creates a new record in SharePoint with the item name and current date time. I then get taken to a form with multiple controls and toggles etc. I have an update button that patch's the form when the user needs to update the record but can continue completing the form until they press the submit button. Basically the patch sometimes works and sometimes does not. I'm guessing it's an issue with the lookup of the record title that is the problem.
I am having a problem with something similar to this. I have a variable that stores the record from a dataverse table, so the column is named after the dataverse column id (ex: "cr590_title"). When I patch to the dataverse like this { Title: "This is a title" }, it works, the correct column is updated. But I am trying to patch to the variable, in this same way, and when I checked, the variable had a new column, (ex: "cr590_title" and "Title"). So it is not updating the right column, it does not even let me use the id name for the column. DO you have any ideia how to fix this?
That is fantastic Shane! I use the unique ID in the SQL tables, set to a variable of course, to define my selected Gallery. Your solution seems to be a better option. Thank you. Can you please address the SQL DateTime issue with PowerApps? That is one that I continue to have issues with. Thanks again.
Hey Shane! This doesn't work for me. I am setting a context variable on the 1st screen and passing it to the 2nd screen on navigate. Here the attributes of the record variable serves as my default selected items for some controls . On "OnChange" of one control, I need to patch one of the record variable attributes to blank. I tried out the formula that you showed here , but it doesn't work. Did you do any settings changes for it??
I see its creating a different column in the record. My source is sharepoint and the column name in sharepoint has a space in between. I guess powerapps do not recognize the space and hence treated it as a different column..thinking of doing an addcolum to the variable where i can set the column name and use the new column instead of the sharepoint one..
Hi Shane, First want to start by thanking your for all that you do. I have learned so much from your videos. I was wondering if you can help me with a Patch question. I have a form that I am using for people to view information on products. I have set the data cards to be visible only if there is a value and is not blank. I want to be able to patch into the data card only if that data card is blank, if it is not blank I want a different data card to get the patch. Is this possible?
Hi Shane, I wanted to say thank you again. I was actually able to figure out the code I needed to make this work. It took a few hours of giving up and coming back and trying again. I had a few codes that worked, but did not give me the result I was looking for. I saw in another video of yours, you mentioned if a code works, but isn’t 100% what you want you can just add the // and revisit it later if necessary. Well, this is exactly what happened I changed a few things to a pending code and it worked out perfectly. Thank you
Hello Shane! I'm from Brazil and I developed an application on power apps for my research program in my University, can I register the code of the application? Wich programing language does the powerapps use?
Hi Shane, I need help. I am creating a collection from a connection to a view of my SQL. However, this view has an invoice filter where I look for the products in the table. When I'm creating the collection, I don't know how to search for my invoice. I did it as follows I created a button, and on that button I made the following formula Collect(ExibeProd; Filter('[dbo].[PA_PROD_NOTA]';DataCardValue1.Text = NOTA )) DataCardValue1.Text is the field where the user places the note number [dbo]. [PA_PROD_NOTA] is the name of my view in the database ExibeProd is the name of my collection. The problem is that not all fields in my search are filled in the collection. [NOTE] column only
You can't filter results with text inputs If your invoices are all integer, you should use Collect(ExibeProd; Filter('[dbo].[PA_PROD_NOTA]';Value(DataCardValue1.Text) = NOTA ))
Hi Shane, Create video! The real problem is the application that writes the data in SQL. Before writing the data to the database they must trim the data.
They aren't spaces that are being passed by SQL. I have this problem with an export I receive. I look at it in NP++ and the character is hidden not a space. I still don't know what the character is. So this may be why you can't reproduce the incorrect data. What ever application they are using to enter the SQL data is injecting these hidden characters.
Hi Shane, I have a gallery where I’m using groupby. When the gallery item is clicked it takes you to another gallery where I am then showing the ‘DATA’. I am wanting to have a trash can so that I can remove an item from the ‘DATA’ and the data source which I have managed to do, however I can’t get the VarRecord to update so that the gallery resets itself and doesn’t show the item I have just deleted. I have tried what you do in this video by setting the VarRecord to a Set(VarRecord (Remove(VarRecord.DATA,thisitem)) but no joy. Any thoughts. When I run the above without the Set it does successfully remove the item from Data, but I can’t get the gallery to update. Any thoughts? Ta
You are a life saver!!! I just spent more hours than I care to admit trying to figure this out. You have been such a tremendous help to me on so many occasions. Thank you, Shane!
Glad to help. This video was an odd, so glad it was the piece you needed.
Genius. Was about to spend likely 4 hours figuring out a solution to a specific problem but then wisely checked if you had cracked it already. Thank you!
Glad to help. 😀
When I applied the patch variable method in this video, my apps started freaking out and saying the variable now was an incompatible type. Every time I set the variable from a gallery with ThisItem, Power apps recognized it as a record type variable. When I tried to patch the record with Set(Variable, Patch(Variable... , Power Apps recognized it as an Error type, which broke everything.
After a little testing, I think I found a different way to patch a variable. With this method, you aren't actually "patching" the variable, but rather resetting the variable with the updated value that was edited. the formula is:
Set(Variable, Lookup(Source, UniqueIDField = Variable.UniqueIDField))
This seems to work for me and PA doesn't get all freaked out.
Thanks Shane for your great videos, tips, and troubleshooting! You are a great teacher.
Glad you got it. We use this a lot and it works but one of my customers had a similar error. 😕 Still not sure why.
The reminder that the patch needs to get set saved me a bit of time. Luckily I stumbled on it when I needed it. Thanks.
And I do use these function nitty griity videos a lot. Just need to make sure my weird search matches your metadata.
Thank you very much…Showing is how you troubleshoot is very helpful!
As you know, we spend a LOT of time doing that. It’s good to see how others do that. Thanks!
You're welcome!
Love these types of videos, real world problems. Great fix.
Thanks Tommy. Showing my pain seems to help a lot of people. 😀
Shane, so many good quotes in this video "it's okay to blame PowerApps" was one that made me laugh...also the one about getting out your abacus to come up with a solution. You have a gift of teaching this stuff to the frustrated and struggling. I appreciate how real you make it!
Glad you enjoy my goofiness Patrick. Thanks 🙏
Thanks Shane. Everyone needs a nerdy friend. 😊. Troubleshooting tips are so helpful.
Absolutely! 🐶
Thanks Shane! I had a similar problem when sending info to power automate where the convert file type didn't like the space. The trim function has just solved that! Life saver :)
Awesome!
It's a wonder I have any hair left trying to patch a record variable only to find it kept returning to the original values. Thank you so much 👍
Happy to help and be nice to that hair. It doesn't seem to last forever. 🤣
You are the best, Shane!
Thanks 😊
PowerApps seems to have more difficulty with it working correctly when developing things. I too, have found something that doesn’t work and then I wait a minute, or take the code out and put it back in, or reboot it…. Then amazingly it might work!
Considering it’s basically all web based and no local application, like having Visual Basic, power apps works amazingly well. I’m surprised it doesn’t have more hiccups or attitudes. I like it a lot!
Hi Shane, odd question on Patching. Can you use a variable column name in a Patch function so you can Copy/Paste the same function to all fields on an edit form? Something like onchange UpdateContext({ctxCurrentColumnName: Parent.DataField});
Patch(
Data source,
Record to update,
{ctxCurrentColumnName: Value(Self.Text)}
);
Or is this a step too far?
Doesn't work Jon :( There is a lot of that clever stuff I have tried with not luck. Sorry
Love your videos Shane, it's helped me on many occasions.
I have a strange issue with patch...
I have used a hybrid editform and submit form and the patch function on different button selects.
I select a item from a combox, I then press a button that creates a new record in SharePoint with the item name and current date time. I then get taken to a form with multiple controls and toggles etc. I have an update button that patch's the form when the user needs to update the record but can continue completing the form until they press the submit button.
Basically the patch sometimes works and sometimes does not.
I'm guessing it's an issue with the lookup of the record title that is the problem.
I would also guess you have a lookup issue. 😑 With SharePoint I like to use ID for the lookups
Thanks a million Shane for showing me that I'm not the only one blessed with those weird power apps behavior! :)
It is a fun game for sure!
I am having a problem with something similar to this. I have a variable that stores the record from a dataverse table, so the column is named after the dataverse column id (ex: "cr590_title"). When I patch to the dataverse like this { Title: "This is a title" }, it works, the correct column is updated. But I am trying to patch to the variable, in this same way, and when I checked, the variable had a new column, (ex: "cr590_title" and "Title"). So it is not updating the right column, it does not even let me use the id name for the column. DO you have any ideia how to fix this?
That is fantastic Shane! I use the unique ID in the SQL tables, set to a variable of course, to define my selected Gallery. Your solution seems to be a better option. Thank you. Can you please address the SQL DateTime issue with PowerApps? That is one that I continue to have issues with. Thanks again.
I do need to cover that one. I will put it back on my list.
@@ShanesCows Thank you.
Hey Shane! This doesn't work for me. I am setting a context variable on the 1st screen and passing it to the 2nd screen on navigate. Here the attributes of the record variable serves as my default selected items for some controls . On "OnChange" of one control, I need to patch one of the record variable attributes to blank. I tried out the formula that you showed here , but it doesn't work. Did you do any settings changes for it??
I did not change anything. Try to recreate my exact demo and see if it works.
I see its creating a different column in the record. My source is sharepoint and the column name in sharepoint has a space in between. I guess powerapps do not recognize the space and hence treated it as a different column..thinking of doing an addcolum to the variable where i can set the column name and use the new column instead of the sharepoint one..
Use ‘column with space’ single quote helps
14:15 Oh the misery you have saved me Shane, thanks again.
Happy to help 😎
Another nice one Shane!
Thank you Asif!
Hi Shane,
First want to start by thanking your for all that you do. I have learned so much from your videos. I was wondering if you can help me with a Patch question. I have a form that I am using for people to view information on products. I have set the data cards to be visible only if there is a value and is not blank. I want to be able to patch into the data card only if that data card is blank, if it is not blank I want a different data card to get the patch. Is this possible?
Hi Shane,
I wanted to say thank you again. I was actually able to figure out the code I needed to make this work. It took a few hours of giving up and coming back and trying again. I had a few codes that worked, but did not give me the result I was looking for. I saw in another video of yours, you mentioned if a code works, but isn’t 100% what you want you can just add the // and revisit it later if necessary. Well, this is exactly what happened I changed a few things to a pending code and it worked out perfectly. Thank you
Hello Shane! I'm from Brazil and I developed an application on power apps for my research program in my University, can I register the code of the application?
Wich programing language does the powerapps use?
I am not sure what you mean by register. Power Apps don’t run stand-alone outside of Power Apps.
Hi Shane, Is there a way to access a local network file from a powerapp?
Yes via the on-premises data gateway. I have never done it but I know others have.
Can you please add a video about running total in PowerApps. Thank you!
Look for my video on Sum. ruclips.net/video/DF4KX1oSrVI/видео.html
Hi Shane, I need help.
I am creating a collection from a connection to a view of my SQL. However, this view has an invoice filter where I look for the products in the table. When I'm creating the collection, I don't know how to search for my invoice.
I did it as follows
I created a button, and on that button I made the following formula
Collect(ExibeProd; Filter('[dbo].[PA_PROD_NOTA]';DataCardValue1.Text = NOTA ))
DataCardValue1.Text is the field where the user places the note number
[dbo]. [PA_PROD_NOTA] is the name of my view in the database
ExibeProd is the name of my collection.
The problem is that not all fields in my search are filled in the collection. [NOTE] column only
You can't filter results with text inputs
If your invoices are all integer, you should use
Collect(ExibeProd; Filter('[dbo].[PA_PROD_NOTA]';Value(DataCardValue1.Text) = NOTA ))
Thanks for the assist 😻
Hi Shane, Create video!
The real problem is the application that writes the data in SQL. Before writing the data to the database they must trim the data.
Agreed!
They aren't spaces that are being passed by SQL. I have this problem with an export I receive. I look at it in NP++ and the character is hidden not a space. I still don't know what the character is. So this may be why you can't reproduce the incorrect data. What ever application they are using to enter the SQL data is injecting these hidden characters.
Hi Shane,
I have a gallery where I’m using groupby. When the gallery item is clicked it takes you to another gallery where I am then showing the ‘DATA’. I am wanting to have a trash can so that I can remove an item from the ‘DATA’ and the data source which I have managed to do, however I can’t get the VarRecord to update so that the gallery resets itself and doesn’t show the item I have just deleted. I have tried what you do in this video by setting the VarRecord to a Set(VarRecord (Remove(VarRecord.DATA,thisitem)) but no joy. Any thoughts. When I run the above without the Set it does successfully remove the item from Data, but I can’t get the gallery to update. Any thoughts? Ta
Try Reset(data source)
Thank you sooooo much I have being pull my hair out with this.
You are so welcome!
How do you patch a record if new or upate a record if it is already in sharepoint?
Use this video to see if a Duplicate exists. ruclips.net/video/Ap3_Ea9H8b0/видео.html
Thanks Shane much appreciated can you create a Covid 19 App return to work and and desk allocation
Desk allocation is interesting. I did do a form covid solution ruclips.net/video/462l8JuJ9xM/видео.html
Nice video and also learn new things from it.
Glad to hear that
OMG YES!!!! Thank you!
You are so welcome!
"Four hours in and that's where the madness starts." I'm way ahead of you. I can get to madness in minutes.
Most recently I was scooping up some data fields that were not behaving at all right, and came to find that each one had a CRLF at the end :(
Crazy how a little bad data can drive us crazy :)
Yes 🙏🙏🙏 thanks I need this trick today 😎😎😎 cool
Glad to help. 😀
Cool , keep coming
Will do. 😎
i think that the Set patch does not work anymore... now it just adds a new line in the record with the same name and different data
I just did a test and it worked the same for me. :(
Set(varRecord, Patch(varRecord, {Department: "Test"}))
Did Bold Zebras have become PowerApps?...
Kind of. More PowerApps911 spun out of Bold Zebras when we decided to become more focused on the Power Platform.