Power automate get first item of an array When to use which one and why? The choice isn’t as clear cut as you may expect. I don't have the ID of the item. In this post, I’ll Do you need to test if your array is empty? This post is going to show you how to test for an array with no elements in Power Automate. Apr 24, 2024 · This Power Automate tutorials explains how to use Power Automate Split String into Array with real examples. I believe the expression items ('Apply_to_each') ['Name'] should work in your case. It's easier than you think! Oct 21, 2017 · One additional note, the Add Dynamic Content menu will only show items from one level of arrays, so if you want to access these nested items you’ll need to add an Apply to each first, and select the array before you can use the item. Feb 22, 2023 · The chunk function in Power Automate can divide or split a string into chunks of equal length. You might find you need to create your own arrays when working Jul 24, 2025 · This article shows how to create and work with variables to store values in your cloud flows. Jun 7, 2023 · In this Power Automate tutorial, We will discuss what is Power Automate Parse JSON Object and how to parse Json object to array in Power Automate with an example. In this the function requests for two parameters one being the array to operate on and the second being number of parameters to skip. I think it is easy to get the single random item (I will demonstrate that also). You probably encountered during your work with Power Automate that for example the Dataverse List rows action will give you automatically an Apply to each loop action. Then, look loop over the filtered array and set the variable to whatever is in the array items. Since I can't send an approval email inside of a for each, I need to somehow get access to that one element outside the array. Mar 1, 2024 · I am new to Power Automate, but based on another community post, I successfully created a flow to automatically copy items created or modified in one Sharepoint List to another in real time. Nov 13, 2018 · This post is all about unnecessarily complicated data structures like nested arrays with a single item in them. Mar 19, 2022 · This will return the first item in the collection of values returned from the “Get items” step. This expression will access the 'Name' property of the Sep 12, 2023 · Learn how to get items from a list using Power Automate Desktop. Aug 8, 2022 · Here's how you can select an element from an array based on certain condition in Power Automate Flow. Aug 5, 2022 · Here's how you read a value from Array variable based on Index value Oct 3, 2024 · Power Automate is a very useful tool for data migration and transformation in certain contexts. Whether you're working with small or large arrays, this guide will help you identify array techniques and methods that will help you along the way! Oct 5, 2022 · I have a Flow that performs a Get items. Mar 24, 2024 · Method #1: Append To Array With Variables Method #2: Append To Array Using The Compose Action Method #3: Use The Select Action Instead Of Append To Array Comparing Append To An Array Methods Performance Introduction: The Case ID Array We will explore how to use Power Automate to create an array of Case IDs. Step-by-step guide to filter SharePoint list data efficiently in your flows. Dec 10, 2019 · To tell the Parse JSON action how to interpret your object, you can click the Generate Schema button and paste the content you'll get from that object. In this post I will shed some light on arrays and many of the common scenarios that you may face with arrays in Power Automate. Enter to the room: the Power Automate first function which is used for retrieving the first item from an array or string. Feb 10, 2023 · Learn how to handle arrays with Power Automate. DMC, Inc. How to use the length () function in Power Automate I will show you how to use the Power Automate length () function by creating an Instant cloud flow. Sometimes it’s a simple array, but more often it’s an array of objects. If I understand your use case correctly, you're trying to access the 'Name' property within each item of your filtered array to personalize the emails. But if we only want the last element of the array, then we have two choices. Conclusions You might need to skip the first or last item from an array in your loop. In Power Platform, for certain business scenarios we must extract first, and last characters of a given string or First and Last items present in an array. Note This reference guide applies to both Azure Logic Apps and Power Automate, but exists in the Azure Logic Apps documentation. In addition, we will also cover how to parse JSON objects to array dynamically in Power Automate. Example: Suppose I have taken a list of values like SharePoint, Power Automate, and Power BI. No loops, no comparing it item by item, a single action that’ll do the filtering for you. Aug 7, 2022 · Here's how you can pick attribute values from Array of Objects and store it in a new Array in Power Automate Flow. Get both the arrays into your flow and let the ‘Filter array’ do the work. Apply to each in Power Automate Get Values in a JSON Object with the Parse JSON Action In Power Automate, you can easily parse JSON objects by using the Parse JSON action. Jul 31, 2023 · First function You can craft your filter expression so that the output is wrapped in the First function. How to avoid uncessary loop by use of the first function and item index in array. Jun 8, 2023 · This Power Automate tutorial explains everything about Power Automate Apply to Each Current Item and many more. This action lets you convert a JSON string into a JSON object which then allows you to easily access items in the JSON as dynamic content. An array is a data structure in Power Automate that stores multiple values in a single variable. Oct 14, 2023 · In this article, we will learn and explore the IndexOf function in Power Automate flow with 10 real-time examples using SharePoint Online as a data source. An expression with the Power Automate item function is used on the left side of the comparison to target the Status column. Using these techniques, you can ensure that your flow only processes the relevant data from your array. This Video of Contents: 1. This is the syntax of the length () function in Power Automate. For example, you might use an array to store names, email addresses, or ages. I will start with creating arrays, then I will look at manipulating arrays, but first of all what are arrays? In most common programming languages you will recognize the term array as a block Apr 20, 2025 · Reference information including syntax and examples for the First, FirstN, Index, Last, and LastN functions. Follow this simple guide to extract specific items and manage data more efficiently in your flows. Please note that the run history view cannot currently show the outputs from inside of nested apply to each. Apr 30, 2024 · Learn how to use Power Automate Get Items Filter Query with 8 real examples. Though they are different actions, the capabilities for both the actions are same. Initially, I have shown you Apr 23, 2022 · Re: Get Value from list via index stored in variable (Power Automate Desktop) Shanks , im kind of a noob in power automate , i just started picking it up and there isn't a lot of tutorials going around about using it Aug 9, 2020 · This is how the flow looks after I choose the dynamic field "Manager Email". Here's how to access the values and use them in your flow. Oct 22, 2024 · This Power Automate tutorial explains how to get last & first item ID from SharePoint list in Power Automate with various examples. Jul 16, 2025 · Split String Using the split () Function in Power Automate In Power Automate, the split () function is used to break a string into an array based on a specific delimiter. May 22, 2024 · Power Automate Array Variable To initialize an array variable in Power Automate, see the below-mentioned steps: Array: An array is a data structure with a list of items or elements with the same data type, like string or integer. Could cause bugs if items filtered are non-unique and non-identical. This article describes how to work with these actions. Create a variable. I want to use a Compose action to temporarily limit my main loop's input the first n items of the array. Sep 21, 2023 · Get items from a SharePoint list using Power Automate Desktop Here, we will see how to get items from the list using Power Automate Desktop. However, there might also be the case that you are looking Sep 26, 2021 · If you work with Power Automate, it’s very helpful to understand the underlying JSON and how to get a specific value. I'd like to work with that single item downstream in the flow, but I want to avoid the "Apply To Each" loop that is automatically inserted when I reference any property of the array item. Aug 24, 2022 · Arrays are part of the building blocks of Power Automate , and we can get arrays from many actions, like the SharePoint “Get Items” action, for example. I would like to capture the value in a Column named 'DateEntry' in the first record of the Get items output. Aug 11, 2024 · The Power Automate select action can select specified columns of an array, add new columns, update existing values, add an index number, etc. Sep 18, 2020 · However, if it's a JSON object collection, then first need to find the item by the index and then find the items' value by property name. Fairly New to Power Automate Flows and not sure of the proper way of accomplishing this. But there are a lot of times that we only want the first element of the array. Nov 25, 2024 · The Power Automate Send An HTTP Request To SharePoint action can return more than the limit of 5000 list items by using pagination. Dec 11, 2024 · Learn how to use the skip() function in Power Automate. We provide examples for the most common use cases. In most situations the order doesn’t really matter, but there’re some cases when it does. Jul 1, 2025 · Access to Power Automate. It's easier than you think! Jun 18, 2025 · Learn how to filter an array by index in Power Automate. To be able to address the lookup fields in the query, we add an “Id” suffix to the column name (the Exercise lookup column is referenced by “ExerciseId”). Mar 21, 2021 · I'm trying to get the latest subfolder from a folder using Power Automate Desktop. The expression in the Map field Oct 18, 2021 · Solved: How to add dynamic elements in your Flow. The array is created from a checkbox selection in a Microsoft form and I would want to loop through and create a work item for each instance (item they checked. Jan 31, 2021 · When you convert an array into a string in Power Automate, the first thing to consider is: “what type of array do I need to process”? If it’s a simple array, you can use the join (…) expression. In Power Automate, arrays are often used when handling data from API calls, SharePoint lists Dec 15, 2021 · Power Automate expressions make it easy to split a string by the first space, if you convert it to an array first. Aug 25, 2025 · Learn how to effectively use the Filter Array action in Power Automate to filter and extract specific data from arrays and objects. So today, we’ll see how to parse an array more efficiently without an “Apply to each From there, my head went to "Get Items" and "Filter Array" based on Name. It makes sense, but how about when we know that there’s only one element. Each array item has an ID and Name as shown in the table below. This is particularly useful when you need to perform actions for each item in your array data. Jul 12, 2023 · Accessing the first element of an array in Power Automate In Power Automate, expressions play a significant role in performing tasks efficiently. It's Jun 15, 2023 · Hello @Markus44, Your scenario is certainly a common one when working with arrays in Power Automate. I'm looking for the code to just get the value of the string because dynamic content doesn't provide it. Power Automate can seamlessly perform tasks on all items within an array, enabling actions such as populating documents, conducting calculations, updating records, and much more. Feb 22, 2024 · I can't get the max expression to work, it just throws an error, the only time I've had it working it would only get the first item in the PBI data array not the biggest. So arrays will be quite common in a flow. Aug 22, 2019 · The Current Item actually contains several properties including "@odata. Should have only one item if the list was unique. Mar 15, 2025 · I would like to cover one of my best practices in today's blog post for working with Power Automate. When you get data in your flow from an external source such as a SharePoint list, a Dataverse table, or an Excel table it will be an array of records for each row of data. For example, variables can help you track the number of times a loop runs. I am trying to use the Power Automate functionality within Power BI and am struggling to figure out how to select only the first value of a field within the “Apply To Each”, and append it to a string variable and use this variable in query to filter results. Mar 22, 2024 · Lets say you have an array and you want to take the first element of it. May 3, 2023 · In this scenario, the “Get items” action will return an array value and this is why power automate automatically generates an “Apply to each” outside your “append to string variable” action. Then, I cant figure out how to get the first item. Sep 27, 2023 · Hi Guys, I am using the below to get the first element from a "recognise text in image\PDF" output, is there a similar expression to get the second element? Many thanks Jan 26, 2025 · A Power Automate flow uses the Get Items action to obtain the Paid Time Off list items. Be aware, the last item wins. Expression to access the array The first step is to get only the “results’ array from the object, and then use it in an ‘Apply to each’ action to process all items (users). Sep 29, 2023 · New to Power Automate and I'm struggling with what seems to be a very small problem and likely be a doddle for someone to resolve: I have an array that looks like this: { "index": 0, &quo May 11, 2017 · The Get Items action is configured with a "maximum get count" of one, but of course that one item is still in an array. To get the first item of your array—add a Compose action (optional but good for testing purposes) and use an expression. Apr 30, 2023 · Use "Filter array" action and filter array based on the ID and then you can use first () function to get the SharingLink property value. The expression in line 3 above splits a string into chunks of length equal to 1 and returns the results as an array. Here's the strategy that can be used in all types of actions. items ('Apply_to_each') is the present code and need to drill down and get just the " Value " property. So today, we’ll see how to parse an array more efficiently without an “Apply to each Oct 12, 2021 · When parsing arrays, our first reaction is to add an “Apply to each” action to fetch elements. This guide covers the different methods to extract, combine, join and filter values of multiple arrays, helping you to get your desired output. You can use the 0 index to get the first item in your arrays, but there is a special formula that can also be used to get the first item. You can create variables for data types such as integer, float, boolean, string Mar 26, 2020 · In Power Automate we need to use the SharePoint action “ Get items ” to be able to query the list for items based on the two input variables. Oct 13, 2020 · Learn how to obtain the first item in an array and the first file from a file array in Power Automate. Although guide refers specifically to logic app workflows, these functions work for both flows in Power Automate and workflows in Azure Logic Apps. May 12, 2021 · 1 I have an action in a Power Automate flow that returns an array of objects. Let’s see how to use it efficiently. I'm trying to use Get Item to retrieve the value in a single column so I can update a variable. How can I obtain this value and use for further steps in the Flow? I need all the Get items information so a Get item isn't feasible. Nov 19, 2023 · Summary Once you switch from the single user to multiple people picker in SharePoint items, the Power Automate flows get more complicated. Nov 17, 2024 · I am using Compose with First () expression, to try and get the first Value from a Select Array. 0 is the 1st item, 1 is the 2nd item, 2 is the 3rd item, etc. It'll then create a schema automatically and translate any future input. This is because arrays in Power Automate use a zero-based index for their order. Dec 1, 2020 · 3 I'm trying to fetch an item from a list to perform some operations on (parsing JSON specifically) but when I use the Get Items action it returns an array, even if I select the top 1 from the results. Oct 17, 2023 · When you retrieve a record from Dataverse or any data source by using filter condition using List Rows, it returns the matching records from the table which you can use loop for further action steps in Power Automate. If this were sql I would do a max () function to get a single value. A tool to send HTTP POST requests with a JSON array to your flow. The Filter action afterwards evaluates the SharePoint list items and returns only the items where Status equals Submitted. This is helpful when you have a long string that contains multiple values separated by a character like a comma, space, colon, or any other symbol. Jan 18, 2023 · Today a short post, about the item and the items function in Apply to each steps. This is possible by using expressions to remove the first or last item from your array when referencing the array in a Apply to each step of your flow. Sep 26, 2024 · In subsequent steps I use a For each action to iterate over each task in the array, but during development I don't want to iterate over hundreds of items during every test run. So that’s where the Power Automate “first “function comes into play. Working with arrays Get shared values from two arrays Get unique values from array(s) Check if array contains a specific value Create an array Extract data from an array Apr 3, 2023 · A classic example is comma separated data in a string. Sep 3, 2021 · In this post, you will learn how to get random ITEMS with Power Automate. The Get items - Filter Query is including records from the previous month. I don't know OData filter syntax and can't quite figure it out. Also, I will show you how to parse JSON to get the first value from an array using Power Automate. The Power Automate split function returns an array with the data which can be further processed. But how do I iterate though it to get the values I need? Mar 6, 2021 · So if you want to use a property from the Get Items action then Power Automate will automatically add the action to an Apply to each loop as it comes from an Array (see image below). Jan 13, 2022 · In Power Platform, for certain business scenarios we must extract first, and last characters of a given string or First and Last items present in an array. Aug 12, 2023 · Hello. Oct 19, 2023 · In this “Power Automate Array IndexOf” article, we will learn how to extract a particular element from the Power Automate array variables with real-time project examples or how to get array elements by their value in Power Automate. Jan 3, 2024 · Don't overlook the Array when using Power Automate flows. If multiple entries, filter on some other value. Feb 20, 2025 · Learn Power Automate Filter Array with 17 practical examples. Feb 14, 2020 · I've been reading up on articles I found via several search engines, trying with compose and set variable but either it goes into a apply each block, which I don't want, or I keep on getting the entire above string sent back to my Power Virtual Agent. any thoughts? Mar 28, 2024 · In Power Automate, how can I extract specific elements from an array based on their index? For instance, how do I retrieve the first, second, and subsequent elements from a given array? Dec 9, 2020 · One option will be to use the skip function present in power automate. In my case, the response will only contain a single item in the array. Mar 20, 2022 · How to extract a item from compose. The Select action will loop through each item of the array, starting from the first character (“1”) and progressing to the last character (“0”). Conclusions This article has explored how to loop through an array in Power Automate. Now I want to use a select action to reshape my data. This post is about the item vs items functions. Example: -1 [Power Automate length () function Oct 13, 2020 · Learn how to obtain the first item in an array and the first file from a file array in Power Automate. Mar 6, 2021 · I will now show you how to avoid having unnecessary Apply to each loops being added to your Flow and instead just access the first element of the array using an Expression. Now, the result of an array with given values will display like Nov 5, 2021 · To set a value of CustomerName variable you can use either initialize variable or set variable action (depends of the scenario) and use as value the first element of the array: variables ('Results') [0]. May 22, 2024 · In this tutorial, I will explain how to remove the first element from an array in Power Automate and then move on to removing the last item. Next, I will discuss how to eliminate an array’s specific element and empty element with the help of Power Automate. Feb 7, 2020 · Power Automate adds Apply to each (loop) in many places. Apply to each in Power Automate In this Power Automate Video tutorial, I have clearly shown you how we can create an array from a SharePoint list using Power Automate flow. From initializing variables to adding items, this tutorial covers it all. Do you need to create an array in your flow? What is an array in Power Automate? An array is an ordered list of items. The Power Automate First function returns the first item of a given collection or the first character of a given string. Oct 12, 2024 · An array is simply a collection of items. Apr 1, 2025 · Use Power Automate to loop through an array of items to check multiple conditions and take actions based on those conditions. . First And Last function can be used in power automate to achieve this functionality. A new or existing cloud flow to which you can add data operations. And since it’s an array, you’ll have to loop through all the items, and for each item loop through the users. The Parse JSON action can't take an array as input, only a single object. Jul 14, 2021 · Confused about the difference between item() and items() in Power Automate – especially when working with Apply to each loops? In Power Automate, item() and items() are functions used inside loops. If you want to do it for each item in your Compose's output, you can use an "Apply to Each" and then point the Filter Query at the "Current Item" (it'll be at the very bottom of your dynamic content). It returns the whole row / object (not sure what the right terminology is sorry), however I am trying to get the value itself. Dec 4, 2022 · If you just want the First one, you can use the expression "first ()" - in between the brackets you put the output from your Compose. The first get items iterate though the list names stored as a list The second get item gets scan through the list names and output the values In the compose I can see the values in JSON for each list. Once I have selected that, I want to be able to pass that through as the Assigned To field for the Approval step. type", ID and Value. What can I do to prepare the item (s) in the Get Items action to be Nov 3, 2024 · Am trying to get output in Power Automate as only "Mv_somethingunkown", while just searching as Mv as the array will be dynamic and after Mv the text will be changed everytime. I know from this item I want the “Name” column for instance. Mar 19, 2024 · The first item of an array starts at 0, second, 1, third 2 etc. You don’t need the skills to create a whole JSON by yourself, but you should be able to read one. Oct 7, 2021 · Arrays are part of the building blocks of Power Automate. These items can be strings, numbers, or objects (like JSON). It becomes cumbersome to have everything inside the Apply to Each, and it would be a lot simpler if we could get the unique value. Apr 3, 2025 · Learn how to check if an array contains value in Power Automate using contains() function, using Filter array action, using filter array action for exact matches with various examples. Sep 11, 2024 · Keep reading this Power Automate tutorial to know how to get SharePoint choice values in Power Automate using various examples. For example I have a compose item like below, How to get "AAAA" only and input create a item to sharepoint List. In the example below, [results] is a collection of items, but retrieving user email by property Jun 29, 2022 · The Get items and Get files SharePoint actions for flows in Power Automate let you get items from a list and a library, respectively. In this article we explain how to use the Power Automate split function and show many examples for common use cases of the split function. I tried a work-around which should compare the item from the filter array with the items from "get files" to only end up with my filtered output, but it seems like that they differ to much since I only get "false" thrown. It’s much easier to work with, so don’t be afraid to use it. Jul 10, 2018 · Today I was asked about how arrays (aka collections) work in Power Automate. This applies to: People-pickers Lookups Choice fields Managed metadata Especially if the field is required in SharePoint, flow will insist that you populate it with a value, even if that record already has one. Dec 13, 2023 · Re: Getting a single value from a Parse Json Hello Jon, I have attempted this, the issue is that I am using the Select Option after the Get Items, to select a particular value first from the Get Items array. For example, if you export the SharePoint list items into an HTML table, it makes sense to sort it Sep 2, 2020 · When building flows in Power Automate, there’s a trick when it comes to updating a field where you can select multiple items. Was this reply helpful To create a Power Automate array variable, use the "Initialize variable" action. Oct 12, 2021 · When parsing arrays, our first reaction is to add an “Apply to each” action to fetch elements. The Apply to each action allows you to iterate over an array and process its elements with the item or items function. shares the ultimate guide to using Arrays. May 10, 2024 · Power Automate outputs JSON. I need to use the date to identify Jul 12, 2023 · Moreover, leveraging arrays enhances workflow efficiency. This will tell Power Automate to only look at the first item. Feb 2, 2022 · Working with Power Automate often involves working with arrays. Nov 19, 2024 · The first() function in Power Automate allows you to directly fetch the first item from an array, reducing complexity and making your flows easier to understand and maintain. May 28, 2023 · Learn what Power Automate filter query is, how to use it in Get Items actions, and how to write OData filter queries to filter data in your workflows. Then I started to ask myself: What to do to get 3 or 5 random unique items from an array (list)? What if I would need to get a random number of items from an array (list) where items are not in sequence (some items were deleted, and the IDs Aug 2, 2019 · I have a SharePoint list that has a single item (always). Mar 31, 2023 · See screenshot below. Which is totally fine if you want to process several rows of data. You don’t have a single object where you can easily access the email, you’ll get an array. Follow these steps to use the Parse JSON action. Oct 13, 2023 · Hello All, I'm trying to parse out the value a specific column coming from the Get Items action and store the value in a property. We can get arrays from many actions like the SharePoint “Get Items” action, for example. Dec 23, 2023 · The flow I need to make should check first if the array has a numeric value or not, and if it does, the flow should return its index and a variable. This tutorial covers filtering techniques, best practices, and real-world scenarios to understand filter array. With the key/value mapping you could This option will speed up the loop considerably. For example Nov 5, 2024 · Do you want to know how to use Power Automate ndexOf function? Check out how to use Power Automate IndexOf and also power automate indexof examples. Oct 13, 2017 · Does anyone know how you would do this (reference an item in array) when there is a variable amount of items. We could check the length of the array, use the “sub” function to reduce one element to the size since the indexes start at zero, and access the element of Dec 8, 2024 · Summary There’s currently no expression in Power Automate to compare two arrays and find the differences, but there’s again a workaround. can you do this via expressions. Step-by-step guide with examples to skip items in arrays and process data more efficiently in your flows. Step-by-step guide to automate your workflows and easily access list data for efficient processes. And with arrays of objects there’s a difference between what you get and what you can use. I tyied outputs ('Select')? ['Title'] Ap Oct 18, 2022 · Hi @Digital, Instead of the parse json, filter array actions I would try a Select action instead. This list contains a column of type "Person or Group" with multi-select. any help would be greatly appreciated Feb 7, 2021 · Since you’re interested in the user data, you want to loop through all the “results” and get the desired value for each user. For more information about functions and expressions in Power Automate, see Use expressions in conditions. Jun 8, 2024 · Discover how to create list items in SharePoint using arrays in Power Automate with our detailed guide. However, it falls short when it comes to providing an easy solution for extracting keys from JSON May 12, 2021 · Power Automate action ‘Get items’ will always return the SharePoint items in an order, by default ascending by ID – the oldest items first. Learn how to filter an array in Power Automate! In this article you will find simple and complex examples of using Power Automate Filter array action. I can get the list, and display it, that works fine. This guide covers practical examples, real-world use cases, and advanced tips to streamline your flow logic and handle complex conditions with ease. For example the SharePoint multiple choice column. Before we start creating the flow, set the SharePoint list, add some items to it, and set up an Excel file in the local system. In this post, I’ll break down these functions with clear explanations and practical examples. Apr 30, 2025 · Please review the following article on our blog, which details how to automate retrieving the first item or file from an array using the Encodian Flowr PDF - Split and Utility - Search Text (Regex) In this Power Automate Video tutorial, I have clearly shown you how we can create an array from a SharePoint list using Power Automate flow. Step 1: Open Power Automate Desktop, provide the flow name, and click on Create. Jul 12, 2023 · Moreover, leveraging arrays enhances workflow efficiency. May 23, 2025 · I use an action to get items of a sharepoint list. In the below example im printing it in a teams chat. The issue with this is that I am trying to initialize a variable at the end that will reference the Birthday of the line item and you cannot do this within an Apply to Each. Jul 21, 2025 · You can also use the take () function to get the first item from a split string in Power Automate: take (split (variables (‘YourString’), ‘,’), 1) This splits the string into an array, takes the first item, and returns it using the first () function. To iterate over an array or check an array for a specific item, you can use a variable to reference the index number 'apply to each' array item. - When an item is created or modified - Get Items (Filter: SyncedID eq Body/IDx) Jan 4, 2024 · If the input is an array, it returns the number of elements (items) in the array. lwb dkato rnznmp mcv rklfe ltkarak xmuwm smnj iuuwd tjdbqw iajp htkxen jkomuh wulacftb dhngyjpt