Skip to main content

Notifications

Power Automate - Power Automate Desktop
Suggested answer

How to check the Array size

(1) ShareShare
ReportReport
Posted on by 48
Dear All,
 
I have a (Custom Object) Array variable and i want to check the size. how can i do it in power automate desktop.
 
I have tried with length and count function but it's not working. can you please suggest.
 
Thanks
  • Suggested answer
    Deenuji_Loganathan_ Profile Picture
    Deenuji_Loganathan_ 6,075 on at
    How to check the Array size
    Hi 
     
    You can refer the below example:
     
    Power Automate Desktop Code (Copy and paste into your power automate desktop designer):
    SET SampleJson TO $'''{
        \"configurations\": [
            {
                \"name\": \"Config1\",
                \"value\": \"Value1\"
            },
            {
                \"name\": \"Config2\",
                \"value\": \"Value2\"
            },
            {
                \"name\": \"Config3\",
                \"value\": \"Value3\"
            }
        ]
    }'''
    
    Variables.ConvertJsonToCustomObject Json: SampleJson CustomObject=> CustomObject
    SET ConfigCount TO CustomObject.configurations.Count
    
     
     
    Thanks,
    Deenuji Loganathan 👩‍💻
    Power Automate Desktop Community Champion 🤖
    Follow me on LinkedIn 👥
    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀
     

     
  • Srini007 Profile Picture
    Srini007 2,866 on at
    How to check the Array size
    Hi,
     
    Since this is a custom object, it would be more efficient to append the values to a temporary array variable and then use the Length action. First, declare a temporary array variable, and then use the Append to List action to add the values to that temporary array.
     
    If I have answered your question, please mark it as the suggested answer. If you like my response, please give it a Like.
    Regards,
    Srini
     
     

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard