cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Matt68
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

@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
v-monli-msft
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.

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".

Matt68
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.

@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!

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.

@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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (71,764)