cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jasoned
Frequent Visitor

OnSelect not working inside of Data Card

I am trying to make a link based on a field in PowerApps. I want to be able to click on an icon inside of a datacard from a form. However, when I click on that icon nothing happens.  It works outside of the Data Card, but I want the icon to be able to scroll with the card so I have to put it inside. Does anybody have any suggestions?

 

Capture2018.PNG

18 REPLIES 18

Hello,

This happens because the Form control does not allow user interaction in "View" mode. Even when the child control's mode (Icon control in this case) is set to "Edit", the parent DisplayMode would be respected.

Similar case can be reproduced with other container controls. Example:

1. Create a blank app and add a Gallery control.

2. Add a Button control to the gallery and set the OnSelect formula

3. Set Gallery1.DisplayMode = DisplayMode.View

4. Set Button1.DisplayMode = DisplayMode.Edit

5. Click on the button and observe that the OnSelect formula is not executed. Other interactions (such as Hover effects) do not work as well.

This works, but I have tons cards. This is going to take me a while change all of them and to figure out the best way to go back and forth from edit to display on each card.

 

Thanks for figuring this out!

DavesTechTips
Super User
Super User

Hi everyone,

 

I can't help to feel that the DisplayMode of the controls inside the card should be separate from the card. If they need to be the same as the card one should use Parent.DisplayMode.

 

Anonymous
Not applicable

@ChrisRunbelievable but true. So I navigate now using EditForm(ViewForm1) to bring it up in Edit mode, but I had to disable all the cards with data controls, except the one with the button I need to work in View mode...

TickboxPhil
Advocate V
Advocate V

This oversight badly needs a fix!

 

Field's within a Form's Card often need a little help Icon to use OnSelect and open a help box with guidance to user on what to enter. Pretty basic requirement!!

 

Currently, it works fine in Edit mode, but not in View mode before they read the help and hit edit! As @DavesTechTips notes, there should be no untouchable wiring from Card to Form Mode, we can use Parent if nec. Either way, I see no real reason why OnSelect and similar within Card can't fire in View mode!

 

Will try and get support on this, feels like a bug/issue rather than Idea. Severely hampering app usability.

jmurteira
Frequent Visitor

same problem

Anonymous
Not applicable

Add a custom card with just that button you want to work in View mode.

Load the form in Edit mode.

Set all the data cards except the one with the button to DisplayMode.View

Unfortunately it's not possible to do it the other way round. If Parent.DisplayMode is View, you cannot set a single card to DisplayMode.Edit. View is prevalent.

jmurteira
Frequent Visitor

Its not in view mode!

 

I need a button to fill the current location and I have a button (connected to power automate to get that location) that works if it is outside the form but when I have the same button inside the datacard I want, it doesn't work!

 

jmurteira_0-1643908781936.png

This image doesn't work and I have the form always in edit mode.

 

Thks,

João Murteira

jmurteira
Frequent Visitor

Hey!

 

I figured out a workaround by myself!

I created a component only with my button and defined custom properties to return the location address.

 

Thanks and hope it helps someone!

João Murteira

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,875)