This tutorial is gold! If you consolidate such powerful techniques into an Udemy course, I will immediately enrol it without thinking twice. Thank you so much Damien for bringing us the insights about the Power Automate array
@@DamoBird365 basically here to second what Greg said. Also, I really appreciate you focusing on Automate, which I still find much more of a challenge than Apps. The many possibilities I discovered through your concepts are really valuable!
Thanks Damien, I’m really liking these more intermediate & advance level videos. Also, one more challenge that many might have is converting a stringified JSON array into a proper JSON array. For example, when pulling in data from a Power App, it will be a string instead of an array of JSON objects. Currently I use a Select action with From set to… Split( Replace( Replace( Replace( triggerBody()?['text_7'], '[{', '{' ), '}]', '}' ), '},{', '}|#|{' ), '|#|' ) And the single box input set to… JSON(item()) So it preps the string, replaces the stringified object delimiters to avoid in-data comma errors, then splits the string so each array item is a single stringified JSON object, then converts each stringified JSON to regular JSON in the Select. I’d be interested to see if you or anyone else have a more polished way to do this. Thanks,
Cheers Tyler. I’ve not seen that problem. Power Apps to Power Automate? Do you get an error if you use json() in Power Automate? There’s a similar json() expression in Power Apps too but it won’t parse in Power Apps as far as I recall.
@@DamoBird365 It’s been a year or so, but the last time I used the JSON( ) expression in Power Automate on a JSON array string, it only returned the 1st JSON object. But the Power Apps JSON( ) expression is able to convert an entire collection at once. It’s just the Power Apps connector to flow doesn’t allow an array, so I have to send it as a string.
@@DamoBird365 Huh, Power Automate now converts the entire JSON array properly. I don’t know why I didn’t get that to work when I was first using it a while back. I’ll have to update some templates.
Everyday is a learning day! Just think if you hadn’t mentioned it, you might never have known. I’ve had Power Automate json to Power Apps woes before, opposite of your problem. Seems you have to use the http response action. But I’m sure I’ve read native support is coming to the default respond to apps/automate.
@@DamoBird365 In the meantime, here is an example Power Apps expression Regex that can convert a string output from a standard Power Apps flow action back into JSON: //Put in the double quotes "" before & after each string value in each Regex key value pair, but do not use those double quotes "" with any non-string datatypes. //So if one of the middle key value pairs was "Test2": "AbcString", then use the Regex ""Test2"":""(?[^""]*)"" but if it was "Test2": 123, then use Regex ""Test2"":(?[^""]*) //Also the 1st key value pair includes the starting object curly bracket with the escape backslash \{ and the last key value pair includes the ending object curly bracket with the escape backslash \} ClearCollect(Collection2,MatchAll(DataOutput,"\{""ID"":(?[^""]*),""Comment"":""(?[^""]*)"",""Col2"":""(?[^""]*)""\}")) Video on this method from April Dunham: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2xWiFkBf294.html
I need some videos on how to deal with nested arrays within a object…. Like a list of servers that has their hostname, ip address, location, and array of installed software.
If you can send me a meaningful example, damien@damobird365.com, I can take a look at this. Sometimes I know the solution but I don't know the problem.
Thanks! More great stuff. I still haven't solved that odata returns a header, then a body with sev fields and a "value": which this is the array of objects that I'm really trying to get to. :-)
Nice Job! I've got some more work to duplicate them to make sure I understand. One question how do you differentiate the "Select" action from the "Filter Array" action. It seems the "Filter Array" doesn't do much formatting and provides a more robust filter condition whereas, the "Select" doesn't really filter--it gives you more of a view of just the data you want to see. However, you've shown the "Select" can combine data from other tables or objects.
I never considered using XPath! Suggestion and a Question - I think throwing into the video title key words like "...Object Techniques - Sum, Max, Min" may increase viewer count cause those terms would've caught my eye. I'm actually trying to find a good GroupBy with a Count without using ApplyToEach. My data looks like this: [{Title: "Sorcerers Stone"}, {Title: "Chamber of Secrets"}, {Title: "Sorcerers Stone"}] And I want a print out like this: [{Title: "Sorcerers Stone", Count: 2}, {Title: "Chamber of Secrets", Count: 1} ] Any ideas? The old dataverse connector let you group by but the new one doesn't.
Thanks for that suggestion. I’ve got a video on xpath, albeit not sure if I’ve done summing. You will have seen the filter array and length method based on the male/female count? Get the distinct titles with union, loop through them, filter on each current item, use length and output each loop as an object to a new array.