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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Associative array equi...
Power Apps
Unanswered

Associative array equivalent in PowerApps

(0) ShareShare
ReportReport
Posted on by

Hi

I need to create some kind of array so I can set text using its values:

MyArray={1:"one",2:"two"}
Set(val1, 1)
And then set text field to MyArray[val1]

Is it possible in Powerapps?

Thanks

Categories:
I have the same question (0)
  • Carsten_Growth Profile Picture
    on at

    Your array is simply a 

     

     

    Table({Color:"red"}, {Color:"green"}, {Color:"blue"})

     

    In your case I would operate with a Collection that holds your styles.
    You can also take a look at this component https://powerusers.microsoft.com/t5/Canvas-Apps-Components-Samples/PPOC2020-Company-Color-Scheme-Lookup-Component/td-p/502947 which allows you to story color styles in a collection that then can be called via Lookup(...)

     

  • Max44 Profile Picture
    223 on at

    PowerApps does not support "arrays", for GA or beyond, because it cannot encourage nor accomodate random access into data. The closest data structure in PowerApps would be a single-column table. Still, it's a table, just like SQL tables for example, and as such it is not indexable by row index, i.e. there is no random access. You can think of columns as homogeneous vertical arrays of named values.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard