Hi @Anonymous ,
Do you want to save the 5 question answers into your Excel table (Column1~Column5)?
Do you also want to save overall score for all 5 questions into the "Total" column in your Excel table?
I assume that the data structure of your Excel table looks like below:
Based on the needs that you mentioned, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Within the last question screen of your app, add a "Submit" button, set the OnSelect property to following:
Patch(
'YourExcelTable',
Defaults('YourExcelTable'),
{
Column1: Switch(Radio3.Selected.Value, "Terrible", 1, "Bad", 2, "OK", 3, "Good", 4, "Great!", 5),
Column2: Switch(Radio3_1.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Column3: Switch(Radio3_2.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Column4: Switch(Radio3_3.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Column5: Switch(Radio3_4.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Total: Score /* <-- Score represents the global variable you set up in your app */
}
)
In addition, if you also want to modify previous question answer, I afraid that the global variable Score could not represent the total score you get. Please modify above formula as below:
Patch(
'YourExcelTable',
Defaults('YourExcelTable'),
{
Column1: Switch(Radio3.Selected.Value, "Terrible", 1, "Bad", 2, "OK", 3, "Good", 4, "Great!", 5),
Column2: Switch(Radio3_1.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Column3: Switch(Radio3_2.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Column4: Switch(Radio3_3.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Column5: Switch(Radio3_4.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Total: Sum(
Switch(Radio3.Selected.Value, "Terrible", 1, "Bad", 2, "OK", 3, "Good", 4, "Great!", 5),
Switch(Radio3_1.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Switch(Radio3_2.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Switch(Radio3_3.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
Switch(Radio3_4.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5)
)
}
)
Please take a try with above solution, then check if the issue is solved.
More details about the Patch function, please check the following article;
Patch function
Best regards,