Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Help on Arrays pls :)

(0) ShareShare
ReportReport
Posted on by 6

Hi,

I have the following array being the output of a select function in Power Automate:

[
{
"ART1": "True",
"ART2": "False",
"ART3": "False",
"ART4": "True"
},
{
"ART1": "False",
"ART2": "False",
"ART3": "False",
"ART4": "True"
},
{
"ART1": "False",
"ART2": "True",
"ART3": "True",
"ART4": "False"
}
]
What I would like is a compose (or other!) function, to take that array and have it output a "1" if the ART? is true, or a "" if false.  I would want to feed that output into a Select function which in turn is feeding a word doc repeating control which is working(thankfully!) on other input variables - just cant get my head around this (i'm very new to this expression writing!) 🙂
 
Many thanks in advance,
Lee
 

 

  • Lee1701 Profile Picture
    6 on at
    Re: Help on Arrays pls :)

    Me again 🙂


    I've got a "little" bit further...

     

    I have added a compose action within a for each loop which outputs the number instead of True or False, which is great:

    Lee1701_0-1708257141907.png

    I now need to join the "numbers" together (i'm guessing "join" is my friend here!) - shouldnt be too bad, but my major stumbling block is my understanding of how the repeating control of the document is filled in.  It looks like I have to put the numbers back in to the whole array being fed into the Select section:

    Lee1701_1-1708257306512.png

    So where ARTREQD is, i need to put all of the outputs of the compose/join formulas but insert them at the correct point in the array being fed into Select.  

     

    So in this example where I have 8 rows:

      "host": {
            "connectionReferenceName""shared_wordonlinebusiness",
            "operationId""CreateFileItem"
        },
        "parameters": {
            "source""me",
            "drive""b!TWh4iVZX-OG_LeIfoUTaiT2XYlRLpcRQR16V_fng6xhjZK7HQKcJCKKLt",
            "file""01CS3OGH5Q57GBNBQH6X2YYFOPV772",
            "dynamicFileSchema/83031742": [
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671248",
                    "CDFR""FD30",
                    "Grade""2",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671250",
                    "CDFR""FD30(S)",
                    "Grade""2",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""675255",
                    "CDFR""FD30(S)",
                    "Grade""3",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671249",
                    "CDFR""FD30",
                    "Grade""3",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671252",
                    "CDFR""FD60(S)",
                    "Grade""4",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671251",
                    "CDFR""FD60",
                    "Grade""1",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671254",
                    "CDFR""FD90",
                    "Grade""3",
                    "ARTREQD"""
                },
                {
                    "SurveyReferenceNumber""1001",
                    "MaintainerName""LF",
                    "MainainerNumber""150",
                    "SurveyDate""2024-02-06",
                    "RegisterRefNumber""1001",
                    "DoorRef""671253",
                    "CDFR""FD90",
                    "Grade""1",
                    "ARTREQD"""
                }
            ],
            "dynamicFileSchema/334506159""150",
            "dynamicFileSchema/743455852""LF"
     
    How do I put the numbers from each output of the for each loop into the correct space of ARTREQD?  Any pointers would be gladly welcomed as I am completely stumped 😞
     
    Lee
     
  • Lee1701 Profile Picture
    6 on at
    Re: Help on Arrays pls :)

    Hi,

    Thanks again for helping 🙂

    This is my original flow without trying to add the array that I'm having issues with - this works:

    Lee1701_0-1708169182494.png

     

    So, when it runs, I feed in a "SurveyNumber" into the variable from powerapps, this filters the Get Items list to that survey only (can be anywhere between 10 and 400 rows returned). 

     

    Each survey row has data as seen within the Select function as seen above. 

     

    This Select functions output is fed into the repeating control section of the word document.  All the above items work perfectly.

     

    I am now trying to add in the ART results of which there are 24 per each row in get items.  They report back true or false for each survey.  The form wants the "number" of the ART that fails ie ART 1 fail, put a "1" in the box, ART 2 fails put a "2" in the box etc.  I also need to put all failures in 1 box so was going to join them with a comma separator.  ie 1,3,22.  Only 3-4 ARTs usually fail, so the list wouldnt be long, but I need to check all 24.

     

    I have tried several methods - I was going to use a condition branch for each ART to check its status, set a variable according to that output and then append a string variable for each ART.  I think that would work, but I think it would also be hugely inefficient and was looking for a better way.

     

    Hopefully the above shows what I am trying to do a bit clearer, but if not please let me know and I'll try to expand on it.

     

    Thanks again,

     

    Lee

     

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Help on Arrays pls :)

    @Lee1701 Can you please share a screenshot of your flow? It would help to gain a better understanding. If you are using the New designer please switch to the Classic designer... expand all your actions and upload a screenshot of that. Thx. 

  • Lee1701 Profile Picture
    6 on at
    Re: Help on Arrays pls :)

    Hi CO 🙂

     

    Many thanks for taking the time to respond; much appreciated.

     

    I can see how the "if" statement would work, if i was testing one value, but can i put the whole array through it?  And if so, how?  And, if (no pun!) i can, how do i feed the result into a repeating section?

     

    I appreciate that this is specific, but as i said, i'm new to this and if you can point me generally in the right direction, i'd be very appreciative 🙂  

     

    Many thanks,

     

    lee

     

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Help on Arrays pls :)

    @Lee1701 I cover how to output a number from a true/false value in this section of one of my YT Tutorials. You need to use an if() function. The if() function accepts 3 parameters:

    if([boolean],[truevValue],[falseValue])

    Tip: The expression tooltip is very helpful. It bolds the text of the current parameter you are defining.

    creativeopinion_0-1708107949163.png

     

    Your expression would look something like this:

     

    if([dynamic content],1,'')

     

    Give that a test.

     

    For more flow troubleshooting tips—check out this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

    In this tutorial I cover:

     How to troubleshoot a false Condition action result

     How to get dynamic content when it isn’t selectable from the list of dynamic content

     How to troubleshoot an Apply to Each action that isn’t looping through

     How to troubleshoot a skipped Apply to Each action

     How to troubleshoot a Filter Query

     How to use a SharePoint yes/no column in a Filter Query

     How to use Compose actions to troubleshoot a Power Automate flow

    How to troubleshoot multiple emails being sent

     How to troubleshoot multiple Teams messages being sent

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1