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 / PowerAutomate Append t...
Power Automate
Answered

PowerAutomate Append to Array is failing

(0) ShareShare
ReportReport
Posted on by 32

Append to array variable 2 in my automation fails.  This is a "bird's eye view of my flow":

hbash_0-1684637066999.png

 

Categories:
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    And, what's the error you get?

  • hbash Profile Picture
    32 on at

    The error is: "Append to array variable 2 in my automation fails. "

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    That is not the error. That is the sentence you posted above.

    Please post a screenshot of the error. It usually has details on why the item has failed. Usually because it is not a valid array, or some other reason.

  • hbash Profile Picture
    32 on at

    That certainly is both the sentence I posted and the error. 

    NOTE:

    hbash_2-1684642861507.png

     

     

     

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    The error details. The section directly below that. The part that tells you what happened.

    I can see it in the large red Error pane in your screenshot on the left. It is telling you that it does not accept "Array" as something to append to an Array. 

    Sounds like you actually want an Object, so you can append your Array.

  • developerAJ Profile Picture
    4,763 on at

    @hbash 

     

    Logic was not proper.You need to change the logic. I understand you want to get 3 columns from list and store in arrayVariable. You can do this in two ways. Please refer below.

    developerAJ_0-1684665037582.png

    this method iterates through each item and append to variable. Follow this if you are storing some Values in arrayVariable while initializing. else the second method

     

    developerAJ_1-1684665322605.png

    This method uses select operation. The output of select option is array so just set the arrayVariable to output of select.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • hbash Profile Picture
    32 on at

    Isn't what I have your second solution?

     

    hbash_0-1684708356617.png

     

     

     

     

  • Verified answer
    hbash Profile Picture
    32 on at

    @developerAJ ,

     

    I went with your second solution which works fine.  Thank you!  Here it is as I have it at the moment.  Another question (and thanks!), how do I get that value back to my PowerApp?

     

    hbash_0-1684717743567.png

     

     

    When things have an implied loop vs. "Apply to each" is still a mystery.

     

    I'll see if you can give me a clue on getting the value back and regardless, will approve your solution tonight or in the morning.

     

    Thanks again.

  • Verified answer
    developerAJ Profile Picture
    4,763 on at
    Your PowerApp is Standard or premium App. I mean your app is using only standard connectors or you also have premium connectors.
    
    
    
    if you have premium connectors you can directly use Response action and Send the response as Json.
    
    
    
    if you need to use with Standard connectors than you need to use response to PowerApps and pass the value as string string( variables('allcharitems'))
    
    
    
    in Powerapp use formula similar to this
    
    
    
    ClearCollect(colFlowdata,ShowColumns( MatchAll( com.Run().output,"\{""Question"":""(?<Question>[^""]*)"",""Message"":""(?<Message>[^""]*)"",""UserType"":""(?<UserType>[^""]*)""\}"),"Question","Message","UserType"))

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • hbash Profile Picture
    32 on at

    My raw output isn't great.  Here it is:

    {
    "statusCode": "200",
    "schema": {
    "type": "object",
    "properties": {
    "volley": {
    "title": "Volley",
    "x-ms-dynamically-added": true,
    "type": "string"
    }
    }
    },
    "body": {
    "volley": "[{\"Question\":\"someemail@someplace.com\",\"Message\":\"hi\",\"UserType\":\"User\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"Hello! How can I assist you today with SharePoint On Prem or Microsoft 365 questions?\",\"UserType\":\"Assistant\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"What's your name\",\"UserType\":\"User\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"Hello! My name is Freaky Bot and I'm here to assist you with any questions or issues you may have with SharePoint On Prem or Microsoft 365. How can I help you today?\",\"UserType\":\"Assistant\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"Where are you located\",\"UserType\":\"User\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"As an AI language model, I don't have a physical location. However, I was programmed by OpenAI and I exist in servers that are located all over the world. If you're asking where the servers are located, they are spread out in large data centers across the globe.\",\"UserType\":\"Assistant\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"Where are you\",\"UserType\":\"User\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"As an AI language model, I don't exist in a physical location. I exist in computer servers that are located in various data centers that are managed by OpenAI. These data centers are located all around the world in order to provide fast and responsive service to users like you.\",\"UserType\":\"Assistant\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"How to create a list item using PnP\",\"UserType\":\"User\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"To create a list item using PnP (Patterns and Practices), you'll need to follow these steps:\\n\\n1. Connect to your SharePoint site using PnP PowerShell. You can do this by running the following command:\\n\\n `Connect-PnPOnline -Url <SiteURL> -UseWebLogin`\\n\\n2. Identify the name of the list where you want to create the item. You can do this by running the following command:\\n\\n `Get-PnPList`\\n\\n This command will return a list of all the lists on your SharePoint site.\\n\\n3. Once you've identified the name of the list, you can create the item by running the following command:\\n\\n ```\\n Add-PnPListItem -List <ListName> -Values @{\\\"Title\\\"=\\\"Item Title\\\";\\\"Description\\\"=\\\"Item Description\\\"}\\n ```\\n\\n Replace `<ListName>` with the name of the list where you want to create the item. Also, replace `Item Title` and `Item Description` with the actual title and description of the item you want to create.\\n\\nThat's it! This should create a new item in the specified list with the given title and description.\",\"UserType\":\"Assistant\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"Connect-PnPOnline not found. How do I add it?\",\"UserType\":\"User\"},{\"Question\":\"someemail@someplace.com\",\"Message\":\"If you are getting an error message saying that the Connect-PnPOnline cmdlet is not found, you may need to install the PnP PowerShell module. Here are the steps to do that:\\n\\n1. Open PowerShell as an administrator.\\n\\n2. Run the following command to install the PnP PowerShell module:\\n\\n ```\\n Install-Module SharePointPnPPowerShellOnline\\n ```\\n\\n This command will download and install the PnP PowerShell module from the PowerShell Gallery.\\n\\n3. Once the module is installed, run the following command to import it:\\n\\n ```\\n Import-Module SharePointPnPPowerShellOnline\\n ```\\n\\n This command will import the module so you can use the PnP cmdlets.\\n\\n4. Finally, connect to your SharePoint site using the following command and entering your SharePoint site URL and credentials when prompted:\\n\\n ```\\n Connect-PnPOnline -Url <SiteURL> -UseWebLogin\\n ```\\n\\n This command will establish a connection to your SharePoint site using PnP PowerShell.\\n\\nNow you should be able to use the Connect-PnPOnline cmdlet without any issues.\",\"UserType\":\"Assistant\"}]"
    }
    }

     

    using this version App:

    hbash_0-1684806841596.png

     

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 317 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 247

#3
Henil Profile Picture

Henil 117

Last 30 days Overall leaderboard