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

Adding a radio control in a gallery

Hello,

 

I would like to add a radio control in a gallery with a database on excel.

 

Capture3.PNG

When we test this application, we got a problem. The radio doesn't save his position, it is reset when we come back in this page.

Can someone send us the command we should use. We think we should use the patch command, we are not sure.

 

Best regards.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@Matt68 

If you're going to migrate off of Excel, your next step up would be SharePoint.  After that, SQL.  

Access plays no part of anything, so don't consider that.

Most all will have some latency issues, Excel will be the worse.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

6 REPLIES 6
Highlighted
Community Support
Community Support

Hi @Matt68 ,

 

What is the Items and Default property of this radio control? How the value shows depends on what you set in the Default property. 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hello @v-monli-msft,

 

We put "Thisitem.Etat" in the default property.

 

"Etat" is a column in excel, Excel say us, if it's "true" or "false".

Highlighted
Frequent Visitor

Sorry for double post,

 

On the pics, we can see how we used the command with :

 

  • Items
  • OnChange

Then the 3rd pic shows us how our excel is represented.

 

Best regards.

Highlighted

@Matt68 

The problem is that you are only having the logic in the for Patching your Excel "Etat" column to true.  You don't seem to have any logic that will associate the actual record value with what should be the value of the Radio control.

The fact that you see it at first is because you are on that screen, whatever you click on will patch the Excel to true.  It doesn't even appear that there is logic to distinguish the true or the false - just to do true.

 

So, with a Radio control, you need to have values on each item that can associate with something.  Your current Items are a 3 row table of nothing...so there is nothing to associate with.

My suggestion would be that you set the Items property to some value you can use. 

Let's go with the Items property of : [0;1;-1]

We will associate 0 with false, 1 with true and -1 with no state.

My guess is you don't want the labels to appear since you have a header for the radio controls - so, set the color of the radio control to White.  The circles will remain, but the labels will blend with the background.

In the Default property put this formula:  If(IsBlank(Etat); -1; Etat="True"; 1; 0)

This will set the default to -1 it is is blank, 1 if it is true and 0 otherwise.

Then, in your OnChange action, change the formula to this:

Patch(Tableau1; ThisItem; 
{Etat : Switch('3 radios_2'.Selected.Value;
0; false;
1; true;
-1; "")
}
)

This should give you what you are looking for both saving and displaying.

 

I hope it is helpful for you.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

Hey @RandyHayes 

 

Thank you for your help, it's amazing cause that's working finally !

 

But now I work on a database, what database do you recommended me ?

 

Cause I used my application, I feel a little latencie. I work in database in Excel, maybe i would to use a other application ? Sharepoint ? SQL ? Acces ?

 

Best regards.

Highlighted

@Matt68 

If you're going to migrate off of Excel, your next step up would be SharePoint.  After that, SQL.  

Access plays no part of anything, so don't consider that.

Most all will have some latency issues, Excel will be the worse.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,267)