Don't use PowerApps Gallery Selected Item

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 74

  • @craig.galbraith
    @craig.galbraith 2 месяца назад +5

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

    • @ShanesCows
      @ShanesCows  2 месяца назад

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

  • @FredericLEGUEN-Excel
    @FredericLEGUEN-Excel 12 дней назад +1

    Hi Shane, super great tutorial but in my case, just the action to click on the name of my employees doesn't update the Form 😞 In my case, the form and the gallery are in 2 different SharePoint tables. Have you presented in one of your video a similar case to update in the same page, one Form according to the selected item in th Gallery? Thanks in advance

    • @ShanesCows
      @ShanesCows  11 дней назад

      I think what you are looking for you would want to change the Item property of the Form control to a Lookup function based on the selected value from the Gallery.

  • @stevenned23
    @stevenned23 2 месяца назад +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  2 месяца назад

      Fantastic! Have a great weekend 😎

  • @automan25
    @automan25 2 месяца назад +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 2 месяца назад

      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  2 месяца назад +1

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

  • @generice3398
    @generice3398 Месяц назад +1

    Hey @ShanesCows, thanks again for a great lesson. One question. What if i'm using a Table control instead of a gallery? If I try to assign varRecord: ThisItem on the Table OnSelect, I get "ThisItem isn't recognized" error.

    • @ShanesCows
      @ShanesCows  Месяц назад +1

      I am not sure. I rarely use Data Tables. :( They have a bunch of weirdness, like what you are describing. :( Sorry, I got no help.

    • @generice3398
      @generice3398 21 день назад

      @@ShanesCows No worries, I figured as much, but wanted to make sure I wasn't missing something. Thanks again!

  • @TheMayank1000
    @TheMayank1000 8 дней назад

    Hi Shane is it possible to edit the records in gallery if form is in edit mode and gallery can fetch the records based on Form.

  • @gaeb-365.online5
    @gaeb-365.online5 2 месяца назад +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  2 месяца назад

      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.

  • @beatgruring7519
    @beatgruring7519 2 месяца назад +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.

    • @ShanesCows
      @ShanesCows  2 месяца назад

      Fancy, I like it. 😎

  • @ryankristofferliray8950
    @ryankristofferliray8950 2 месяца назад +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  2 месяца назад

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

    • @ryankristofferliray8950
      @ryankristofferliray8950 2 месяца назад

      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

    • @shawnsiegrist3632
      @shawnsiegrist3632 17 дней назад

      @@ryankristofferliray8950 Add a button to the container, set the width to parent.width and height to parent.height, set the X / Y to 0, and under "Style and theme" for the button set Type to Transparent. Now set the buttons OnSelect property to Set(varSelectedRecord."Gallery Name".Selected). Hope that helps!

  • @SJo-ss6yr
    @SJo-ss6yr 2 месяца назад +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  2 месяца назад

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

  • @lowcodedev
    @lowcodedev 2 месяца назад +1

    This is insightful! Thanks for the tutorial

  • @shawnsiegrist3632
    @shawnsiegrist3632 17 дней назад

    I'm not using a form, I prefer individual controls and Patching the records. One of my controls is a modern drop down, the SharePoint column is a single line of text, when I add varSelectedRecord."Column Name" to DefaultSelectedItems I'm getting an error. If I use a choice column in SharePoint then everything works, but I recall you recommending using single line of text columns whenever possible in SharePoint. Is there a way to use your varSelectedRecord technique with a drop down control and single line of text column in SharePoint? Thank you!

  • @antonlohmayr1719
    @antonlohmayr1719 2 месяца назад +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  2 месяца назад

      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

  • @EMiller500
    @EMiller500 2 месяца назад +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  2 месяца назад +2

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

  • @muhammadzikrilhakim200
    @muhammadzikrilhakim200 Месяц назад +1

    HI Shane. I am new with Power Apps and I want to ask. Can I use this method to replace table.selected method?

    • @ShanesCows
      @ShanesCows  Месяц назад

      Maybe. I don't use Data Tables very often, so I have never tried BUT I think the pieces are there.

  • @a1t0rmenta
    @a1t0rmenta 2 месяца назад +8

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

    • @ShanesCows
      @ShanesCows  2 месяца назад

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

  • @AdiCristea
    @AdiCristea 2 месяца назад +2

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

    • @ShanesCows
      @ShanesCows  2 месяца назад

      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 🥲

  • @jeromemartin8830
    @jeromemartin8830 Месяц назад +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  Месяц назад

      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.

  • @TheKermit2110
    @TheKermit2110 2 месяца назад +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  2 месяца назад +1

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

    • @TheKermit2110
      @TheKermit2110 2 месяца назад

      @ cheers buddy

  • @Bekesam
    @Bekesam 2 месяца назад +1

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

    • @ShanesCows
      @ShanesCows  2 месяца назад

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

  • @aaronsleezer2589
    @aaronsleezer2589 2 месяца назад +1

    What is the formula for Edit Record?

  • @muhannednidal3647
    @muhannednidal3647 2 месяца назад +1

    Excellent method 👏🏻👏🏻👏🏻

    • @ShanesCows
      @ShanesCows  2 месяца назад

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

  • @alexcamilleri3997
    @alexcamilleri3997 2 месяца назад +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  2 месяца назад +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 2 месяца назад

      @@ShanesCows Thanks for your perspective!

  • @nyrrik1337
    @nyrrik1337 2 месяца назад +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  2 месяца назад +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

  • @StephanOnisick
    @StephanOnisick 2 месяца назад +1

    Another key solution. Thanks!

  • @maddiebeatz98
    @maddiebeatz98 2 месяца назад +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  2 месяца назад +1

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

  • @andrewhess123
    @andrewhess123 2 месяца назад

    Good points Shane! Nice!

    • @ShanesCows
      @ShanesCows  2 месяца назад +1

      Thanks Andrew! Have a good week dude.

  • @tomrichardson7792
    @tomrichardson7792 2 месяца назад +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  2 месяца назад

      Agree Tom. More control is always better. 🤩

  • @MrHeadbytes
    @MrHeadbytes 2 месяца назад

    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.

  • @paolovr1970
    @paolovr1970 2 месяца назад +1

    Great Shane thanks

    • @ShanesCows
      @ShanesCows  2 месяца назад

      You are welcome, have a great weekend.

  • @rrtornado
    @rrtornado 2 месяца назад +1

    Game changer once again

  • @jpxs6855
    @jpxs6855 7 дней назад

    i hope you make one for TABLES (that looks like gallery). :)

  • @syedhussain6393
    @syedhussain6393 2 месяца назад +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  2 месяца назад +1

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

    • @syedhussain6393
      @syedhussain6393 2 месяца назад

      @@ShanesCows I missed that :) thanks

  • @oluwatobiyusuf
    @oluwatobiyusuf 2 месяца назад +1

    Thank you Shane

    • @ShanesCows
      @ShanesCows  2 месяца назад

      Thanks. Have a great day.

  • @christianberger6390
    @christianberger6390 Месяц назад +1

    Très intéressant