Note: Power Apps does not support creating column names dynamically at runtime in a collection.
Instead, use a key value structure:
ClearCollect(
colResults,
AddColumns(
colCompanies,
Score,
Switch(
Value,
"Company1", 4,
"Company2", 5,
"Company3", 7
)
)
)
Result:
Value Score
Company1 4
Company2 5
Company3 7
Keep the data in a normalized format:
Company Score
------- -----
Company1 4
Company2 5
Company3 7
This works much better with galleries, forms, filtering, sorting, and patching than dynamically generated column names.
If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
Regards,
Riyaz