Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

How to use DefaultSelectedItems of a radio group button

(1) ShareShare
ReportReport
Posted on by 4
Hi,
 
I have a radiogroup button with these values : 
 
Table({Key: "OK"; Value:" "};{Key: "NOK"; Value:" "};{Key: "Non observé"; Value:" "})
 
What it can do for now is when I click on all my radio buttons, and then to a button, it adds a row to an excel table (with an ID)
What I haven't been able to do is having a default value to my radiobuttons depending on the choices i've made before if I try to modify an existing row
 
I tried giving a global variable to DefaultSelectedItems : 
I have a variable called test_variable and is Set with the onVisible of my page : 
Set(test_variable; "Blank()");;
When I write directly Blank() inside DefaultSelectedItems I have no error and it works, so I don't quite understand how it works.
 
There is no information on the microsoft help page.
 
How can I have a default selected button if I try modifying a row, and none selected if I try adding a new one ?
 
Categories:
  • Verified answer
    MichaelFP Profile Picture
    MichaelFP 1,526 on at
    How to use DefaultSelectedItems of a radio group button
    Do you have this table store in a collection? If you is always set table direct in each radio group button is not a good approach.
     
    try something like that:
     
    create a new collection with the table, to be used for all radio group buttons.
     
    ClearCollect(colItensDefaults;Table({Key: "OK"; Value:" "};{Key: "NOK"; Value:" "};{Key: "Non observĂ©"; Value:" "}))
     
    Set this collection to the values of the radio group, in the Items.
     
    Now, on the default selected items apply a filter on that collection using the value from a existing record,  
     
    Filter(colItensDefaults; Key = "NOK")
     
    and you will see that default value it will be came with the correct selection.

     
     
     
     
    If my answer helped you, please give me a thumbs up (👍). If solve your question please mark as answer ✔️. This is help the community.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard