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.
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