Power Apps Patch Record Variable + Trim, Len, and Troubleshooting

Ғылым және технология

In this video, you will learn how to patch a Record Variable in PowerApps. And along the way you will get to see the data problem that caused me to figure how to do this and the usage of Trim and Len functions. Lots of Fun!
Power Apps Training at training.PowerApps911.com

Пікірлер: 75

  • @tommyhamilton1520
    @tommyhamilton15204 жыл бұрын

    Love these types of videos, real world problems. Great fix.

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Thanks Tommy. Showing my pain seems to help a lot of people. 😀

  • @puppydood
    @puppydood3 жыл бұрын

    Thanks Shane. Everyone needs a nerdy friend. 😊. Troubleshooting tips are so helpful.

  • @ShanesCows

    @ShanesCows

    3 жыл бұрын

    Absolutely! 🐶

  • @jray1429
    @jray14293 жыл бұрын

    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!

  • @ShanesCows

    @ShanesCows

    3 жыл бұрын

    You're welcome!

  • @troybarrett235
    @troybarrett2354 жыл бұрын

    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 :)

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Awesome!

  • @patrickcooley9708
    @patrickcooley97084 жыл бұрын

    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!

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Glad you enjoy my goofiness Patrick. Thanks 🙏

  • @ImranAmiKh4n
    @ImranAmiKh4n Жыл бұрын

    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!

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Glad to help. 😀

  • @headflask
    @headflask2 жыл бұрын

    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.

  • @headflask

    @headflask

    2 жыл бұрын

    And I do use these function nitty griity videos a lot. Just need to make sure my weird search matches your metadata.

  • @HenriqueSilvestre
    @HenriqueSilvestre4 жыл бұрын

    Thanks a million Shane for showing me that I'm not the only one blessed with those weird power apps behavior! :)

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    It is a fun game for sure!

  • @leonelbraga5427
    @leonelbraga54274 жыл бұрын

    You are the best, Shane!

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Thanks 😊

  • @samaritanlucas8680
    @samaritanlucas86803 жыл бұрын

    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.

  • @ShanesCows

    @ShanesCows

    3 жыл бұрын

    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.

  • @ronbakker1300
    @ronbakker1300 Жыл бұрын

    14:15 Oh the misery you have saved me Shane, thanks again.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Happy to help 😎

  • @asifkhawaja
    @asifkhawaja4 жыл бұрын

    Another nice one Shane!

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Thank you Asif!

  • @jyothisrinivas6637
    @jyothisrinivas66374 жыл бұрын

    Nice video and also learn new things from it.

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Glad to hear that

  • @ToddWheeler253
    @ToddWheeler253 Жыл бұрын

    OMG YES!!!! Thank you!

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    You are so welcome!

  • @gerfer6261
    @gerfer62614 жыл бұрын

    Cool , keep coming

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Will do. 😎

  • @mblherry
    @mblherry Жыл бұрын

    Thank you sooooo much I have being pull my hair out with this.

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    You are so welcome!

  • @paolovr1970
    @paolovr1970 Жыл бұрын

    Yes 🙏🙏🙏 thanks I need this trick today 😎😎😎 cool

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Glad to help. 😀

  • @jray1429
    @jray14293 жыл бұрын

    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!

  • @WhatIsThis.WhyDoINeedIt
    @WhatIsThis.WhyDoINeedIt3 жыл бұрын

    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.

  • @ShanesCows

    @ShanesCows

    3 жыл бұрын

    I would also guess you have a lookup issue. 😑 With SharePoint I like to use ID for the lookups

  • @ziadhamandi3595
    @ziadhamandi35954 жыл бұрын

    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.

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    I do need to cover that one. I will put it back on my list.

  • @ziadhamandi3595

    @ziadhamandi3595

    4 жыл бұрын

    @@ShanesCows Thank you.

  • @rivernet62
    @rivernet624 жыл бұрын

    "Four hours in and that's where the madness starts." I'm way ahead of you. I can get to madness in minutes.

  • @rivernet62

    @rivernet62

    4 жыл бұрын

    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 :(

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Crazy how a little bad data can drive us crazy :)

  • @sundrapillay6668
    @sundrapillay66684 жыл бұрын

    Thanks Shane much appreciated can you create a Covid 19 App return to work and and desk allocation

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Desk allocation is interesting. I did do a form covid solution kzread.info/dash/bejne/ZmpmzpqDpa2fqLA.html

  • @williampurcell606
    @williampurcell6062 жыл бұрын

    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?

  • @williampurcell606

    @williampurcell606

    2 жыл бұрын

    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

  • @magdialameen7960
    @magdialameen79604 жыл бұрын

    Can you please add a video about running total in PowerApps. Thank you!

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Look for my video on Sum. kzread.info/dash/bejne/dnporbpqn7bYhqw.html

  • @gabrielbraz9669
    @gabrielbraz9669 Жыл бұрын

    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?

  • @MrJonbuoy
    @MrJonbuoy Жыл бұрын

    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?

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    Doesn't work Jon :( There is a lot of that clever stuff I have tried with not luck. Sorry

  • @franciscolopes8337
    @franciscolopes83374 жыл бұрын

    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?

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    I am not sure what you mean by register. Power Apps don’t run stand-alone outside of Power Apps.

  • @charlesjohnston1575
    @charlesjohnston15754 жыл бұрын

    Hi Shane, Is there a way to access a local network file from a powerapp?

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Yes via the on-premises data gateway. I have never done it but I know others have.

  • @mvos1980
    @mvos19804 жыл бұрын

    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.

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Agreed!

  • @arupjt
    @arupjt4 жыл бұрын

    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??

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    I did not change anything. Try to recreate my exact demo and see if it works.

  • @arupjt

    @arupjt

    4 жыл бұрын

    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..

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Use ‘column with space’ single quote helps

  • @danielbell9192
    @danielbell91924 жыл бұрын

    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

  • @WhatIsThis.WhyDoINeedIt

    @WhatIsThis.WhyDoINeedIt

    3 жыл бұрын

    Try Reset(data source)

  • @yutikapatel5995
    @yutikapatel59953 жыл бұрын

    How do you patch a record if new or upate a record if it is already in sharepoint?

  • @ShanesCows

    @ShanesCows

    3 жыл бұрын

    Use this video to see if a Duplicate exists. kzread.info/dash/bejne/c6RnwaeaaauekpM.html

  • @mappingman
    @mappingman Жыл бұрын

    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.

  • @beatecno
    @beatecno4 жыл бұрын

    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

  • @MrXankiller

    @MrXankiller

    4 жыл бұрын

    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 ))

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Thanks for the assist 😻

  • @rodrik90
    @rodrik90 Жыл бұрын

    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

  • @ShanesCows

    @ShanesCows

    Жыл бұрын

    I just did a test and it worked the same for me. :( Set(varRecord, Patch(varRecord, {Department: "Test"}))

  • @dimaignatiev6370
    @dimaignatiev63704 жыл бұрын

    Did Bold Zebras have become PowerApps?...

  • @ShanesCows

    @ShanesCows

    4 жыл бұрын

    Kind of. More PowerApps911 spun out of Bold Zebras when we decided to become more focused on the Power Platform.

Келесі