cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PBrt
Frequent Visitor

List variable syntax

Hi,

 

I recently tried to dynamically access a list element within a loop (i don't want a for each loop, just specific indexes).

 

I've tried %mylist[%myIndex%]% with %myIndex% = 1 but it doesn't work. Same for %mylist[%'myIndex'%]%. However, %mylist[1]% works perfectly fine.

 

Is it possible to use a variable as a list index parameter?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
yasunm02
Solution Sage
Solution Sage

Hi @PBrt 

The correct syntax is indeed %mylist[variable]%

Problem is, the way you inform the variable, it's considered as text type instead of value type. 

Before throw your variable in %mylist[variable]%, try using 'Convert text to number' to convert your variable in number.

See Solved: Desktop - Extract specific row and column values f... - Power Platform Community (microsoft....

View solution in original post

2 REPLIES 2
yasunm02
Solution Sage
Solution Sage

Hi @PBrt 

The correct syntax is indeed %mylist[variable]%

Problem is, the way you inform the variable, it's considered as text type instead of value type. 

Before throw your variable in %mylist[variable]%, try using 'Convert text to number' to convert your variable in number.

See Solved: Desktop - Extract specific row and column values f... - Power Platform Community (microsoft....

View solution in original post

Hi @PBrt 

 

I think u r mentioned variable way is

incorrect ,correct syntax is %mylist[variable]%

 

Regards

Ahammad Riyaz

 

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,749)