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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Indexing into a List u...
Power Automate
Answered

Indexing into a List using a variable

(0) ShareShare
ReportReport
Posted on by 33

I have a rather lengthy list I have created in P.A.D. That is a few hundred lines long of text.   There is some information on every 4th line I want to pull out and create a new list for.    I created a simple loop in which I increment an index counter called "Position" by 4 and create a new item for my new list.

 

My Code inside Add item to list is as follows:

 

%MyList[Position]% 

 

My problem is that it is adding every fourth character of the first element in MyList.  When I need it to grab every 4th element of the list.  Its accessing the characters of MyList as if it were a String instead of the elements inside the List.  I'm sure its just a syntax error on my part but I read through a few forums but couldnt find my answer. Hopefully someone on here can lend me a hand.    

I have the same question (0)
  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    That sure seems like it would work based on what I know about lists.....could you share a screenshot of what your config looks like?

  • Verified answer
    pwintert Profile Picture
    33 on at

    I went in and changed some of my code.  It is working now.  The short version is that I inadvertently converted my List to a string while trying to replace some characters in my List. It was my first time using a variable in POD to reference my List so I assumed that my mistake was there. Turns out that when I replaced characters in my list it was converting the list back into a string and not back in a List like I thought.  Discovered my mistake by verifying my length of my List.  

  • VJR Profile Picture
    7,635 on at

    Great you found the issue and got it working. You can close the thread now.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 241 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 179

#3
Haque Profile Picture

Haque 159

Last 30 days Overall leaderboard