@Alaa-Alarori
One thing to always keep in mind about ForAll, is that it is really not entirely like a For Loop that you might be used to in a programing environment. Primarily - ForAll *returns* a table. The action you take within the ForAll determines the "shape" of the table returned. ForAll's can be used to do actions within them that impact data, but they require more steps to do so.
So, in your first formula:
ForAll(CommunityProfile, If(Condition, {Community :"AA"}))
Would return a Record with a Community column with the value "AA" for every record in CommunityProfile where the Condition was true. If there were 5 records that met the condition in CommunityProfile, you would have a table with 5 rows, with one column called Community and all with the value of "AA". HOWEVER, you didn't actually do anything with the results of the ForAll...so, nothing happened (not that it was going to be what you wanted anyway).
Your second formula just wouldn't work anyway! You can't assign values quite like that. So we won't go much more on that one.
NOW...what you want to do. You have a few options. One option is to simply use an UpdateIf function on your collection. So, something like this:
UpdateIf(CommunityProfile, Condition, {Community:"AA"})
This would actually update the Community column with "AA" in any record in CommunityProfile that meets the condition you have. (Also note: the UpdateIf will return a table of modified records, should you need to capture the results for some reason.)
The other option is to use the ForAll, but it is much more challenging. The reason is, you would either Patch/Update the record currently being referenced in the ForAll, or re-shape a resulting table to return from your ForAll.
If you use the ForAll to Patch/Update, then you need to have a reference to the current record. Within the ForAll, you can make use of any of the fields/columns of the current record in the ForAll, but you cannot reference the entire record. So, if your data has some identifying component to it (like an ID), then you can reference that to lookup and Patch/Update the actual value in the datasource. Something like:
ForAll(CommunityProfile,
If(Condition,
Patch(CommunityProfile,
Lookup(CommunityProfile, ID=CommunityProfile[@ID]),
{Community:"AA"}
)
)
)
You can see that gets more complex.
That second option in the ForAll is to re-shape the data and return it in your ForAll. This would involve returning either the same record schema (which you'd have to type out for each column) or a different altered schema.
But...I don't believe that (based on your original question and perceived intention) this is what you want to do.
I hope this is clear and helpful for you.