cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanKorchak
Helper IV
Helper IV

Associative array equivalent in PowerApps

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

2 REPLIES 2
Carsten_Growth
Power Apps
Power Apps

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-Loo... which allows you to story color styles in a collection that then can be called via Lookup(...)

 

Max44
Helper V
Helper V

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (79,096)