Powerapps: Clear/Reset Gallery fields with button

1.3k Views Asked by At

I have a simple question that I haven't found or understood anywhere on the internet. I'm a novice powerapps user. I would like to click a button and clear all fields (inputText, checkbox, etc) from a gallery. Details: My data source is some excel tables; this gallery (not a collection or a form for god's sake) has some information from my data source (tab_lista). I tried the following command without success:

Mybutton

OnSelect

ForAll(BrowseGallery1.AllItems;
    If(ThisRecord.Checkbox1.Value = true;Checkbox1.Value = false);;
    ThisRecord.InputText1.Text = ""
)

Segue uma imagem.

enter image description here

1

There are 1 best solutions below

0
On

Scraping an answer here and there, I got it! I used context variable. In the advanced property of both the checkbox and the InputText I put the following in the Reset field.

checkbox1

ResetCheckbox

TextInput1

ResetinputT1

Then I created a button and put the following in the OnSelect property:

UpdateContext({ResetCheckbox:true});;
UpdateContext({ResetCheckbox:false});;
UpdateContext({ResetinputT1: true});;
UpdateContext({ResetinputT1: false})

and it worked!!!