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 / Getting input list fir...
Power Automate
Answered

Getting input list first item (List[0]) into a variable

(0) ShareShare
ReportReport
Posted on by 4
Hello!

I'm new to the Power Automate Desktop program.


Here's my problem: (Updated)

I use Power-Fx, which needed in a later part of the flow, so I can't make a new flow without it.
 
I have an list input inside my desktop flow.
(I created it, by choosing the list datatype. Then in the values Edit field, I switch on the JSON-editor, and entered the following: ["Alpha", "Beta", "Gamma"]).
This is an example list, but the real data list can have a different length (it can be less or more items).

After this I use the "Set Variable" step, to make a new variable. In this variable I want to get the first item from my list. (So I need something like "ListName[0]", which should give me the "Alpha" text back.) - Technically I will need to get every items, by the index, so the index will be a variable, that I will change with a special logic. (Not a simple for-each function).
However, when I try it somehow either gives me the the exact text ("ListName[0]"), or give an error message ("Invalid characters...").
The for-each loop with the current item is not really a solution for me, as the remaining part of the flow uses another for-each. (So this two "loops" should work together,  something like this: A_List[0] B_List[0], then A_List[1] B_List[1], etc...).

I tried a few things, including the %ListName[0]% command, which a lot of other videos and forums says, but nothing worked so far.

About the screenshots. Where I work, we have a strict policy against sharing sensitive data, and the flow (input list) contain these data. That's why I can't share screenshots.
Sorry about it guys!


If you can help me, or give me some guide, I would be thankful!

~ Rob
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,535 Super User 2026 Season 1 on at
    When you can always include a screenshot of the flow, as it provides helpful context.

    I think you might have Power Fx enabled flow and if so then %ListName[0]% is not correct syntax as it would be in normal non-Power Fx flow. So either recreate the flow without Power Fx enabled or use first() -expression.

    In Power Fx you need to use Power Fx expressions to get certain item from a list. Write =First(ListName) into the Set variable action
  • RB-17111346-0 Profile Picture
    4 on at
    Hi!

    I realized I forgot to mention a few things, so I updated my question.

    Sincerely,
     ~ Rob
  • Verified answer
    eetuRobo Profile Picture
    4,535 Super User 2026 Season 1 on at
    Hello,

    You can use Index() -expression. 
    Power Fx is 1 based index so first item is 1 unlike in normal PAD flow its 0 based indexing where first item would be 0.

    So use =Index(ListName, 3) to get the third item from the list.

    Like so:


    Don't mind the warning "Warning: Deferred type provided". That seems to come when you refer to input variables with Power Fx enabled. But if you would create the list in the editor it would not give that error. Like so:

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 589

#3
Haque Profile Picture

Haque 522

Last 30 days Overall leaderboard