Don't use PowerApps Gallery Selected Item

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 60

  • @beatgruring7519
    @beatgruring7519 7 днів тому +1

    Thank you. As always, a great video. Instead of showing "Please select an Item to continue" I prefer to save the previously selected item and revert back to it if the user cancels the form.

  • @craig.galbraith
    @craig.galbraith 22 дні тому +5

    "Evil trash can" gave me a much needed Monday morning chuckle :)

    • @ShanesCows
      @ShanesCows  22 дні тому

      That is the fun, you never know the dumb things I will say 😂

  • @jeromemartin8830
    @jeromemartin8830 23 години тому +1

    Thank you for the video. Excellent as always. Sometimes I use your method for my needs. But why don't you use the Default property of the gallery? If you set it to '{}', you just have to use 'Reset()', and that works. Using a variable is better when you change screens, but that's not the case here.

    • @ShanesCows
      @ShanesCows  9 годин тому

      Totally could do that. Just wasn't were my head was when I was building this one. 😎 That is the fun of Power Apps different ways to do different things.

  • @stevenned23
    @stevenned23 17 днів тому +1

    What a superb video again Shane. I'm so happy with this info!! I changed a view apps I created lately.
    Thanks a lot, from a rainy and grey Netherlands.
    Regards, Steven

    • @ShanesCows
      @ShanesCows  17 днів тому

      Fantastic! Have a great weekend 😎

  • @SJo-ss6yr
    @SJo-ss6yr 21 день тому +1

    Thank you for this valuable information, same recommendation as Wonder Laura is doing in one of here Power Hour Sessions. Sharing is caring and Community Rocks!

    • @ShanesCows
      @ShanesCows  21 день тому

      Laura is awesome. Didn’t know she showed it in power hour recently. My first video with it was 3 years ago. 😎

  • @AdiCristea
    @AdiCristea 22 дні тому +2

    Best way to deal with Gallery.Selected! Thanks, Shane!
    PS. Have you noticed the removal of Fill property in modern buttons? :)

    • @ShanesCows
      @ShanesCows  22 дні тому

      I have, it makes me sad. 🥲 DelayOutput missing on Text Inputs was one someone pointed out this morning. He asked me for a work around and I had no idea 🥲

  • @lowcodedev
    @lowcodedev 22 дні тому +1

    This is insightful! Thanks for the tutorial

  • @nyrrik1337
    @nyrrik1337 20 днів тому +1

    Hi love your vids! Could I maybe suggest making a video on how to implement a two sided swipe to confirm/delete an item in a vertical gallery? Im interested what you could come up with your insight :)

    • @ShanesCows
      @ShanesCows  20 днів тому +1

      I have never really thought about it. In my head there isn't a great way to do it. But if I come up with something I will be sure to share. 😎 Thanks for the idea

  • @TheKermit2110
    @TheKermit2110 22 дні тому +1

    love it! As i've watched you over the years, i've seen you advocate for this method but was never clear why. Now i am !! BTW, how would you default to the 1st record in Gal (in view mode) instead of the option your students opted for with the instruction to select an item? Cheers from the friendly frog!

    • @ShanesCows
      @ShanesCows  22 дні тому +1

      Glad to help my green friend. UpdateContext({varRecord: First(Gallery1.AllItems)}) on your cancel/view actions. 🤩

    • @TheKermit2110
      @TheKermit2110 22 дні тому

      @ cheers buddy

  • @antonlohmayr1719
    @antonlohmayr1719 21 день тому +1

    Love your videos. I was wondering why you dont set the gallery default to {} and add a reset Gallery command to the new and unselect button. Is there a specific reason?

    • @ShanesCows
      @ShanesCows  21 день тому

      Nope, I have never tried that way. Interesting. I still enjoy my variable control and using it across multiple screens but I will try your way next time and give it a look. Thanks

  • @MrHeadbytes
    @MrHeadbytes 5 днів тому

    Hi Shane. Love your videos. I am new to PowerApps and working on implementing a lot of your suggestions in my first couple of apps. This one is great and has helped a lot. I am confused with a delete button. I have this function on my Delete button. After the record is deleted, the form still shows the remnants of the deleted record. How do I fix this?
    UpdateContext(
    {
    deleteMode: true,
    deleteCancelled: false,
    selectedRecord: RecordsGallery1.Selected
    }
    )
    I have tried changing RecordsGallery1.Selected to varRecord and it still seems to delete the record but still has the remnants of the deleted record.

  • @StephanOnisick
    @StephanOnisick 22 дні тому +1

    Another key solution. Thanks!

  • @gaeb-365.online5
    @gaeb-365.online5 11 днів тому +1

    Hi, Thanks four your great videos, Shane. I want to point out that in a scenario, where you e.g. have buttons to perhaps trigger a workflow which is updating the items in the SharePoint List directly I might need to call Refresh(list) to update the data. Then your approach does not work because the locRecord variable does not update to the new data. I cannot find any hook where to update that. If you manually switch items then everything is okay, but that is not what I want to see. If the user clicks the button, the workflow runs successfully I want the user to immediately see the updated data.
    Any Ideas to that?

    • @ShanesCows
      @ShanesCows  7 днів тому

      After you do the Refresh then Set(varRecord, Lookup(datasource, ID = varRecord.ID)) this will get the refreshed version of the record in your variable.

  • @alexcamilleri3997
    @alexcamilleri3997 18 днів тому +1

    Would you recommend to use a Gallery Control inside a Component? If so, would this make things easier with dynamically retrieving fields?

    • @ShanesCows
      @ShanesCows  18 днів тому +1

      It depends on the scenario. If a gallery is going to be reused exactly the same then yes a component makes sense. But if each one is unuqie then it would be more trouble than it was worth.

    • @alexcamilleri3997
      @alexcamilleri3997 14 днів тому

      @@ShanesCows Thanks for your perspective!

  • @Bekesam
    @Bekesam 18 днів тому +1

    Well done, thanks Shane. "IsSelected", pulled out a lot of hair on that one.

    • @ShanesCows
      @ShanesCows  18 днів тому

      Glad this helped. Got to save that hair, as we get older it falls out enough on its own. 🤣

  • @muhannednidal3647
    @muhannednidal3647 22 дні тому +1

    Excellent method 👏🏻👏🏻👏🏻

    • @ShanesCows
      @ShanesCows  22 дні тому

      Thank you! 🙂 It makes Power Apps a lot easier when you control everything. 🙂

  • @oluwatobiyusuf
    @oluwatobiyusuf 14 днів тому +1

    Thank you Shane

    • @ShanesCows
      @ShanesCows  14 днів тому

      Thanks. Have a great day.

  • @paolovr1970
    @paolovr1970 19 днів тому +1

    Great Shane thanks

    • @ShanesCows
      @ShanesCows  18 днів тому

      You are welcome, have a great weekend.

  • @andrewhess123
    @andrewhess123 22 дні тому

    Good points Shane! Nice!

    • @ShanesCows
      @ShanesCows  22 дні тому +1

      Thanks Andrew! Have a good week dude.

  • @EMiller500
    @EMiller500 22 дні тому +1

    By the way, what's up with those "extra rectangle things" that they add in to gallery templates? Do they serve some special purpose, or have some kind of different functionality? Do I lose anything by deleting them?

    • @ShanesCows
      @ShanesCows  22 дні тому +2

      They are just visual markers. You can delete them with no ill effects.

  • @maddiebeatz98
    @maddiebeatz98 19 днів тому +1

    If I have multiple gallery's do I just name them different variables, but it will work the same or is this one use only?

    • @ShanesCows
      @ShanesCows  19 днів тому +1

      Yes. I have plenty of varRecord2 in the world. The more the merrier 🤣

  • @a1t0rmenta
    @a1t0rmenta 22 дні тому +6

    Just when I thought I had 1% of Power Apps under control...

    • @ShanesCows
      @ShanesCows  22 дні тому

      At least .9%? 🤩 Keep working, so much cool stuff to learn.

  • @tomrichardson7792
    @tomrichardson7792 22 дні тому +2

    Using the selected gallery can cause issues with resetting controls. Just doesnt seem to work with some apps. Variables are the way.

    • @ShanesCows
      @ShanesCows  22 дні тому

      Agree Tom. More control is always better. 🤩

  • @automan25
    @automan25 8 днів тому +1

    When I try adding the UpdateContext code to the OnSelect event on a gallery it does not store the record in the varRecord variable. I followed the tutorial to the letter. Any idea why this might be happening? Is there a app level setting I need to enable?

    • @automan25
      @automan25 8 днів тому

      It seems I was using a "Vertical gallery" component instead of a "Blank vertical gallery" component. Not sure why the former doesn't work with this method, but switching it solved the problem. If anyone knows the point of using a "Vertical gallery", I'm all ears.

    • @ShanesCows
      @ShanesCows  8 днів тому +1

      That is really weird. I don't know why the first wouldn't have worked 🥲

  • @aaronsleezer2589
    @aaronsleezer2589 13 днів тому +1

    What is the formula for Edit Record?

  • @rrtornado
    @rrtornado 22 дні тому +1

    Game changer once again

  • @ryankristofferliray8950
    @ryankristofferliray8950 12 днів тому +1

    I encountered a problem. When clicking on the gallery, the selection will not trigger the template fill when you click on components in the layout template, im using blank layout gallery and adds components on it. But when you click on the layout template outside those text box , image, The selection template fill color is okay .

    • @ShanesCows
      @ShanesCows  12 днів тому

      Set the Gallery OnSelect property to be Set(varRecord, ThisItem)

    • @ryankristofferliray8950
      @ryankristofferliray8950 9 днів тому

      Already did that.. idk the reason. What i did was that i put a container behind all components in the template of the gallery list

  • @syedhussain6393
    @syedhussain6393 18 днів тому +1

    I am little confused regarding title of this video, title should be "Don't use PowerApps Gallery ISSelected Item" or "Don't use PowerApps Gallery Selected Item"? because you are still using gallery.selected to show selected item from gallery to form if I am getting you correctly.

    • @ShanesCows
      @ShanesCows  18 днів тому +1

      No, the Item property of your Form should be varRecord when you switch everything over. 🤩

    • @syedhussain6393
      @syedhussain6393 17 днів тому

      @@ShanesCows I missed that :) thanks