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.
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
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.
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.
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!
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 :)
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
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.
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 🥲
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?
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.
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?
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
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!
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.
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!
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.
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?
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?
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.
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 .
@@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!
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.
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.
Fancy, I like it. 😎
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
Fantastic! Have a great weekend 😎
"Evil trash can" gave me a much needed Monday morning chuckle :)
That is the fun, you never know the dumb things I will say 😂
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.
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.
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!
Laura is awesome. Didn’t know she showed it in power hour recently. My first video with it was 3 years ago. 😎
This is insightful! Thanks for the tutorial
Glad to help! 😎
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 :)
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
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.
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.
@@ShanesCows No worries, I figured as much, but wanted to make sure I wasn't missing something. Thanks again!
Just when I thought I had 1% of Power Apps under control...
At least .9%? 🤩 Keep working, so much cool stuff to learn.
Best way to deal with Gallery.Selected! Thanks, Shane!
PS. Have you noticed the removal of Fill property in modern buttons? :)
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 🥲
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?
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.
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?
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
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!
Glad to help my green friend. UpdateContext({varRecord: First(Gallery1.AllItems)}) on your cancel/view actions. 🤩
@ cheers buddy
Another key solution. Thanks!
You bet!
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.
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!
Well done, thanks Shane. "IsSelected", pulled out a lot of hair on that one.
Glad this helped. Got to save that hair, as we get older it falls out enough on its own. 🤣
Excellent method 👏🏻👏🏻👏🏻
Thank you! 🙂 It makes Power Apps a lot easier when you control everything. 🙂
HI Shane. I am new with Power Apps and I want to ask. Can I use this method to replace table.selected method?
Maybe. I don't use Data Tables very often, so I have never tried BUT I think the pieces are there.
Très intéressant
😎
Great Shane thanks
You are welcome, have a great weekend.
Good points Shane! Nice!
Thanks Andrew! Have a good week dude.
Would you recommend to use a Gallery Control inside a Component? If so, would this make things easier with dynamically retrieving fields?
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.
@@ShanesCows Thanks for your perspective!
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?
They are just visual markers. You can delete them with no ill effects.
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?
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.
That is really weird. I don't know why the first wouldn't have worked 🥲
Thank you Shane
Thanks. Have a great day.
Game changer once again
Thanks 😊
What is the formula for Edit Record?
No change. :)
Using the selected gallery can cause issues with resetting controls. Just doesnt seem to work with some apps. Variables are the way.
Agree Tom. More control is always better. 🤩
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 .
Set the Gallery OnSelect property to be Set(varRecord, ThisItem)
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
@@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!
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?
Yes. I have plenty of varRecord2 in the world. The more the merrier 🤣
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.
No, the Item property of your Form should be varRecord when you switch everything over. 🤩
@@ShanesCows I missed that :) thanks