Skip to main content

Notifications

Power Automate - Building Flows
Answered

Feature Request: Addition of keys() Function in Power Automate

Like (0) ShareShare
ReportReport
Posted on 14 Jan 2025 14:36:55 by 2
Dear Power Automate Team,

I am writing to request the addition of a keys() function to Power Automate. This function would significantly enhance the platform's capability to handle JSON objects more efficiently.

Function Description: The keys() function would return an array of all the keys present in a given JSON object. This functionality is crucial for dynamically accessing and manipulating JSON data without hardcoding key names.
 
Example Usage: Given a JSON object: (i.e. response from an HTTP call to Azure Management API - Get Web App Connection Strings)
Returns a JSON body, we're trying to get the Keys from the "properties" collection, example response below.  In our use case, Connection Strings will frequently be added and removed and we need to support N number of keys. 
{
  "Customer1": {
    "value": "Server=azuresqlserver.database.windows.net;Database=Customer1Live;User ID=Customer1;Password=FakePassAbc123",
    "type": "SQLAzure"
  },
  "Customer2": {
    "value": "Server=azuresqlserver.database.windows.net;Database=Customer2Live;User ID=Customer2;Password=FakePassAbc123",
    "type": "SQLAzure"
  },
  "Customer3": {
    "value": "Server=azuresqlserver.database.windows.net;Database=Customer3Live;User ID=Customer3;Password=FakePassAbc123",
    "type": "SQLAzure"
  },
  "Customer4": {
    "value": "Server=azuresqlserver.database.windows.net;Database=Customer4Live;User ID=Customer4;Password=FakePassAbc123",
    "type": "SQLAzure"
  },
  "Customer5": {
    "value": "Server=azuresqlserver.database.windows.net;Database=Customer5Live;User ID=Customer5;Password=FakePassAbc123",
    "type": "SQLAzure"
  },
  "Customer6": {
    "value": "Server=azuresqlserver.database.windows.net;Database=Customer6Live;User ID=Customer6;Password=FakePassAbc123",
    "type": "SQLAzure"
  }
}
The keys() function would return:
["Customer1", "Customer2", "Customer3", "Customer4", "Customer5", "Customer6"]
Benefits:
  • Dynamic Data Handling: The keys() function would allow users to dynamically access and iterate over JSON objects, making it easier to work with varying data structures.
  • Reduced Hardcoding: Users would no longer need to hardcode key names, reducing the risk of errors and making flows more maintainable.
  • Enhanced Flexibility: This function would provide greater flexibility in handling complex JSON objects, enabling more sophisticated automation scenarios.
Current Challenges: Without the keys() function, users must resort to workarounds that involve manually listing keys or using complex expressions and loops. These methods are not only cumbersome but also prone to errors, especially when dealing with large or nested JSON objects.
 
The addition of the keys() function would streamline these processes, making Power Automate more powerful and user-friendly and I believe this enhancement would greatly benefit the Power Automate community.
 
Thank you for considering this request, if this isn't the proper place to request features, please provide a link where features should be requested.
 
Kind regards,
Sean
  • Verified answer
    David_MA Profile Picture
    David_MA 8,219 on 14 Jan 2025 at 14:51:39
    Feature Request: Addition of keys() Function in Power Automate
    These forums are for assistance with developing and troubleshooting flows and not for feature requests. You can submit feature requests at Power Automate Ideas · Community

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard
Loading started