web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset Multiple Variabl...
Power Apps
Answered

Reset Multiple Variables or make Multiple Variables = Blank

(0) ShareShare
ReportReport
Posted on by 116

I have a questionnaire type app that has many radio buttons each with three options ["Defect","No","N/A"], once all the questions have been answered and if any of them equal defect then a radio button (ill call it RadioButtonALL) with two options is visible ["Yes","No"]

 

The visible syntax for the RadioButtonALL is 

 

(var1 ="Defect"||var2 ="Defect"||var3 ="Defect"||var4 ="Defect"||var5 ="Defect"||var6 ="Defect"||var7 ="Defect"||var8 ="Defect"||var9 ="Defect"||var10 ="Defect"||var11 ="Defect"||var12 ="Defect"||var13 ="Defect"||var14 ="Defect"||var15 ="Defect"||var16 ="Defect"||var17 ="Defect"||var18 ="Defect"||var19 ="Defect"||var20 ="Defect"||var21 ="Defect"||var22 ="Defect"||var23 ="Defect"||var24 ="Defect"||var25 ="Defect"||var26 ="Defect"||var27 ="Defect"||var28 ="Defect"||var29 ="Defect"||var30 ="Defect"||var31 ="Defect"||var32 ="Defect"||var33 ="Defect"||var34 ="Defect"||var35 ="Defect"||var36 ="Defect")
&&!IsBlank(var1)&&!IsBlank(var2)&&!IsBlank(var3)&&!IsBlank(var4)&&!IsBlank(var5)&&!IsBlank(var6)&&!IsBlank(var7)&&!IsBlank(var8)&&!IsBlank(var9)&&!IsBlank(var10)&&!IsBlank(var11)&&!IsBlank(var12)&&!IsBlank(var13)&&!IsBlank(var14)&&!IsBlank(var15)&&!IsBlank(var16)&&!IsBlank(var17)&&!IsBlank(var18)&&!IsBlank(var19)&&!IsBlank(var20)&&!IsBlank(var21)&&!IsBlank(var22)&&!IsBlank(var23)&&!IsBlank(var24)&&!IsBlank(var25)&&!IsBlank(var26)&&!IsBlank(var27)&&!IsBlank(var28)&&!IsBlank(var29)&&!IsBlank(var30)&&!IsBlank(var31)&&!IsBlank(var32)&&!IsBlank(var33)&&!IsBlank(var3)&&!IsBlank(var34)&&!IsBlank(var35)&&!IsBlank(var36) 

 

It works great, however if the user comes to do another questionaire without shutting the app down, the RadioButtonALL is visible from the previous questionaire..

 

How can i Reset all the Multiple Variables or make the Multiple Variables = Blank, so that it only appears after all variables are not blank or equal Defect?

 

ive tried

 

(var1="Blank")&&(var2="Blank")&&(var3="Blank")&&(var4="Blank")&&(var5="Blank")&&(var6="Blank")&&(var7="Blank")&&(var8="Blank")&&(var9="Blank")&&(var10="Blank")&&(var11="Blank")&&(var12="Blank")&&(var13="Blank")&&(var14="Blank")&&(var15="Blank")&&(var16="Blank")&&(var17="Blank")&&(var18="Blank")&&(var19="Blank")&&(var20="Blank")&&(var21="Blank")&&(var22="Blank")&&(var23="Blank")&&(var24="Blank")&&(var25="Blank")&&(var26="Blank")&&(var27="Blank")&&(var28="Blank")&&(var29="Blank")&&(var30="Blank")&&(var31="Blank")&&(var32="Blank")&&(var33="Blank")&&(var3="Blank")&&(var34="Blank")&&(var35="Blank")&&(var36="Blank")

and 

IsBlank(var1)&&IsBlank(var2)&&IsBlank(var3)&&IsBlank(var4)&&IsBlank(var5)&&IsBlank(var6)&&IsBlank(var7)&&IsBlank(var8)&&IsBlank(var9)&&IsBlank(var10)&&IsBlank(var11)&&IsBlank(var12)&&IsBlank(var13)&&IsBlank(var14)&&IsBlank(var15)&&IsBlank(var16)&&IsBlank(var17)&&IsBlank(var18)&&IsBlank(var19)&&IsBlank(var20)&&IsBlank(var21)&&IsBlank(var22)&&IsBlank(var23)&&IsBlank(var24)&&IsBlank(var25)&&IsBlank(var26)&&IsBlank(var27)&&IsBlank(var28)&&IsBlank(var29)&&IsBlank(var30)&&IsBlank(var31)&&IsBlank(var32)&&IsBlank(var33)&&IsBlank(var3)&&IsBlank(var34)&&IsBlank(var35)&&IsBlank(var36)

 

yet i cannot get it too work?

 

could someone more knowledgeable help?

Categories:
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    To make multiple variables blank, you can use the Set function (if they are global variables, i.e., if they were created using the Set function) or the UpdateContext function (if they were created with this function):

    Set(var1, Blank()); Set(var2; Blank()); Set(var3, Blank()); /* others here */; Set(var36, Blank())

    or

    UpdateContext({ var1: Blank(), var2: Blank(), var3: Blank(), ..., var36: Blank() })

     Hope this helps!

  • AaronRichardson Profile Picture
    148 on at

    Frame challenge incoming!

    What if instead of using so many variables and controls you used a collection and gallery? Then resetting the entire set of responses could be done in one action versus ~60 times.

    Here is the example:

    AaronRichardson_0-1604992756124.png

    The radio buttons on the right can only be interacted with if at least one radio button in the gallery is selected as "Defect".

    And here is the tree view:

    AaronRichardson_1-1604992789480.png

    As you can see, very few controls to manage, even with five different items!

    Here is how to accomplish this.

    In the OnSelect of the collectData button, we have this formula:

    AaronRichardson_2-1604993018529.png

    You would, of course, need to update with the schema/data to match your requirements. Note here that I default the response to "N/A".

    Next, the Items property of the gallery needs to be the collection we just created:

    AaronRichardson_3-1604993123578.png

    Then we can add a label to display the questionnaire item (in this case, Item Name):

    AaronRichardson_4-1604993189404.png

    Then we need a radio button control in the gallery. Once added, set the Default property to ThisItem.Response,:

    AaronRichardson_5-1604993299304.png

    set the Items property to a table with the options you want (in this case, N/A, No, Defect),:

    AaronRichardson_6-1604993369483.png

    and set the Reset property to a variable:

    AaronRichardson_8-1604993556514.png

    For the radio control on the right, we change the DisplayMode property to look at the gallery radio controls to see if any have been switched to "Defect":

    AaronRichardson_7-1604993455231.png

    And finally, we add the crucial piece, the logic to reset all the radio buttons. This lives in the second button OnSelect:

    AaronRichardson_9-1604993640209.png

    Clicking that button resets all radio options at once! This architecture makes it very simple to add or remove options from the questionnaire and troubleshoot when things don't work. You'll obviously need to tailor to your requirements, but this design principle should work. 

    Hope this helps!

     

     

  • Questionasking Profile Picture
    116 on at

    Cheers Aaron, i just wanted to say thanks, i did select the other as the correct answer as its a quick easier solution, but ive saved yours for when i build another app with a large amount of variables as its better for my long term career devolpment. Cheers 😀

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard