cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

Is it possible to set a conditional default selected item for a radio button in the canvas app form?

Hello, 

 

I have noticed that radio button choice is not saved after the form is submitted to the SharePoint. Therefore, I am working on the workaround: if the value in the Choice field is equal to X, then the Default item in the radio buttons equals to X as well.

My default function for the radio buttons:

Default = If(ChoiceField.Selected.Value = "Buying","Buying", "N/A")


Unfortunately, I get this error: "This rule creates a circular reference between properties, which is not allowed. A property cannot reference itself or other properties affected by its value."

 

Does this mean that It is not possible to a condition Default value for the radio buttons? Perhaps someone could share any advice?

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

@mantastg08876 

Save yourself the trouble and don't use choice fields in SharePoint.  Set the column type in SharePoint to single line of text and make your Items property of the radio control ["Buying", "Not buying", "N/A"].  Then set the default to the one you want or leave it blank. Set the Update property of the card to Radio1.Selected.Value

View solution in original post

@mantastg08876 ,

Agree with @Drrickryp here - but if you really want to leave the Choice field there and (after reading your posts a number of times, I think I have got your rather unusual requirements), it seems you simply want to do two things:-

  • Display the result of what the user has selected in a drop-down in a radio control, but conditionally
  • Update the data source with this result

I would attack this the reverse way with the Default of the Radio Button being

If(YourDropDownName.Selected.Value = "Buying","Buying", "N/A")

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi @mantastg08876 ,

I assume ChoiceField is the name of the Radio button?

If so you cannot make a control property conditional on its own value, however why not just make it "N/A" as it is already "Buying" if that is the value selected/stored in it?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

Hi @WarrenBelz , 

Thank you for the comment. The name of the radio button is Decision_radio and I am trying to its Default value based on the selected value in the Choice field (name: ChoiceField)

The configuration is this:
- I have added a Choice_DataCard with items "Buying", "Not buying", "N/A";
- In the same DataCard, I have added a radio button with the same items;
- I would like the radio to show which item is selected based on the value selected in the Choice field
2020-12-30_14-28-29.png

The scenario I am trying to fulfil is:
1. In the form, user selects the Decision_radio button value (Buying or Not Buying);
2. The ChoiceField value is updated based on radio button's selected item (Buying or Not Buying);
3. When the form is submitted, the ChoiceField value is uploaded to SharePoint;

4. When user opens created SharePoint list item, the Decision_radio button, indicates which decision was selected

Do these steps make sense? Maybe there is another way how to make the Decision_radio button to show which item (Buying or Not Buying) was selected after the form is submitted to SharePoint?

Hi @mantastg08876 ,

What is the Update of the Card, what type of field is it writing back to in SharePoint and what is the Default of the radio control?

Hi @WarrenBelz ,


Update of the card = ChoiceField.Selected

Type of field = Choice

Default of the radio control = ""

@mantastg08876 

Save yourself the trouble and don't use choice fields in SharePoint.  Set the column type in SharePoint to single line of text and make your Items property of the radio control ["Buying", "Not buying", "N/A"].  Then set the default to the one you want or leave it blank. Set the Update property of the card to Radio1.Selected.Value

View solution in original post

@mantastg08876 ,

Agree with @Drrickryp here - but if you really want to leave the Choice field there and (after reading your posts a number of times, I think I have got your rather unusual requirements), it seems you simply want to do two things:-

  • Display the result of what the user has selected in a drop-down in a radio control, but conditionally
  • Update the data source with this result

I would attack this the reverse way with the Default of the Radio Button being

If(YourDropDownName.Selected.Value = "Buying","Buying", "N/A")

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (26,133)