Hi
Since we are an educational bunch, please share what you tried instead of just asking us to do the work for you, especially the errors.
But let me try to help you
Let's start with what you need
1. A Column in the Collection already has to exist, lets call it FOO and its a Number (since you are using CountRows)
2. Lets say that in the Gallery its your txt_count_accuse and lets further assume its a Label, since you said Default
3. Lets say you have a Button called UpdateStuff
Here is my sample for you.
First I created a Gallery, and 2 Collections
I have MySample, which is a collection with these items
ClearCollect(MySample,
{
TheCount: 0,
MyString: "one"
},
{
TheCount: 0,
MyString: "two"
}
);
I then have my second Collection which I filter, like you do so that my Text Input is populated
ClearCollect(TheValues,
{
MyString: "one"
}
,
{
MyString: "two"
}
);
Below you see the screen and the Filter, where I am checking if MyString = "one" and for both it returns 1. Which is ok.
Now I have to write the code to Update the MySample collection so that they say 1, versus the 0 you see above when I create it.
LOOK BELOW for the Update Code
Ok, so we have the screen and all the collections.
now I want to update the Collection here is the code.
You can see that I loop through AllItems
I patch MySample(which is the Gallery Items Collection)
I use ThisRecord as the Row to Update
And then I use TheCount as my field (my new one)
And then I use the Value(ofmy textfield.Text)
ForAll(Gallery1.AllItems,
Patch(MySample, ThisRecord,
{
TheCount: Value(ThisRecord.txt_count_accuse.Text)
}
);
);
And bingo it works
After pressing my button with the code above my 0's are now 1s