JSON Array in Power Automate - Walkthrough lesson with examples

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 78

  • @stevenhampson8657
    @stevenhampson8657 Рік тому +4

    Thanks for the quick but effective examples and going into the expressions, explaining what they are doing. Your finger was pointing in the right direction, and now, after watching this, I am also heading in the right direction. Cheers

    • @DamoBird365
      @DamoBird365  Рік тому

      If you want to learn a bit more about JSON and try some challenges, take a look here
      ua-cam.com/video/G3Q1WuZTWuY/v-deo.html

    • @chromebul
      @chromebul 3 місяці тому

      @@DamoBird365 HI Damian, I’m having an issue with objects/arrays. I have a flow that triggers when a form is submitted, the flow gets the responses but not all the questions have answers due to branching. I would like to filter out all the blank responses so that I can put the rest of the questions that do have responses into a html table to email. I’ve tried parse json, select, filter array and apply to each but can’t seem to get it to work. I imagine this would be a fairly routine task but I haven’t been able to find a solution. Might be a useful video idea, I know I would love to see it 😂

  • @ravennasantos8094
    @ravennasantos8094 23 дні тому +1

    Excellent! Thank you for sharing this valuable knowledge. It really helped me.

  • @stubbeee
    @stubbeee Рік тому +1

    Thank you for taking the time a year ago to create and post this. I found it while trying to build a solution in Power Automate for my local baseball association and it was extremely helpful to me. It was very clear and easy to follow and I appreciate your approach of building the solution step by step.

    • @DamoBird365
      @DamoBird365  Рік тому

      Nice one Scott 👍 what else have you got planned for your baseball team? Feel free to reach out if you don’t find the video you’re looking for.

    • @stubbeee
      @stubbeee Рік тому +1

      @@DamoBird365 I have a few forms that coaches can use to request practice time and game time changes. I then use power automate to automatically reply as well as copy the other members of our board who need to be notified.

  • @jasonthedogcatcher
    @jasonthedogcatcher 2 роки тому +1

    This was fantastic. I was able to sort out my flow in no time with your excellent tutorial. Keep up the great work.

  • @alanjwells
    @alanjwells 3 місяці тому +1

    Excellent, I was scratching my head on this one for a while.

  • @dawitdegefa2289
    @dawitdegefa2289 7 місяців тому +1

    Simple, to the point and awesome 👌

  • @c016smith52
    @c016smith52 2 роки тому +1

    Amazing video, learned a ton of stuff. Thank you, so much good stuff here!!

  • @Keepfaith101
    @Keepfaith101 2 роки тому +1

    This video was super helpful thank you! I subscribed

  • @johnMpawson
    @johnMpawson 2 роки тому +1

    Thank you - that was so clear and concise.

  • @maricarmenjimenez4877
    @maricarmenjimenez4877 7 місяців тому +1

    Lovely video ^^ Thank you! It's a very helpful video and you have a very clear way of explaining. 🙏👌

  • @fayefouladi2973
    @fayefouladi2973 10 місяців тому +1

    Thank you so much. This worked for me.

  • @PedrodaSilva-i3d
    @PedrodaSilva-i3d Рік тому +1

    Very clear explanations, great content, thank you. I wonder, have you made any content showing how to change properties within the arrays (for example to keep track of a yes/no state for a specific object)? At first thought sounds like something i would only be able to do using array variables.

    • @DamoBird365
      @DamoBird365  Рік тому +1

      You could check out challenge 2 here: Unlock the Power of Arrays in Power Automate: Learn Common Techniques & Solve 5 Challenges!
      ua-cam.com/video/G3Q1WuZTWuY/v-deo.html and check out setproperty() learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#setProperty

    • @PedrodaSilva-i3d
      @PedrodaSilva-i3d Рік тому +1

      @@DamoBird365 Thank you! I had already watched the video and with this suggestion i realized all that was needed is to change the expression from "addProperty(...)" to "setProperty()"

  • @frenamakenson9844
    @frenamakenson9844 2 роки тому +1

    That Was So Clear man ! thank you

  • @Franklinvaz
    @Franklinvaz 3 роки тому +1

    Nice and easy Damo... Love it! Thanks...

    • @DamoBird365
      @DamoBird365  3 роки тому

      Thank you very much Franklin - any time 😉

  • @akashjain9821
    @akashjain9821 Рік тому +1

    Thanks buddy this was really helpful :)

  • @mhjort1
    @mhjort1 Рік тому +1

    Thank you so much, this is really helpful

    • @DamoBird365
      @DamoBird365  Рік тому

      Make sure you check out ua-cam.com/video/G3Q1WuZTWuY/v-deo.html for more tips on JSON and Data Expressions.

  • @chahineatallah2636
    @chahineatallah2636 14 днів тому

    great video!

  • @SoumavoGuria
    @SoumavoGuria 6 місяців тому +1

    so well explained

  • @mgtd1138
    @mgtd1138 Місяць тому +1

    Hi, great video. Attempting to extract a value based on an ID value. If I'm trying to pull the "Current State" only for ID 123, what's the best practice?
    {
    "ID": 123,
    "Current State": "The state is really bad.",
    }

    • @DamoBird365
      @DamoBird365  Місяць тому

      A filter array with that condition and then an expression first(filterarraybody)?[‘current state’]

  • @GabeStillman
    @GabeStillman 3 місяці тому +1

    This is great, thank you!

  • @kurthenderson6848
    @kurthenderson6848 Рік тому +2

    Hi Damien, Excellent video, good pace and great information. I was able to follow everything without issue but I'm dealing with a more complex array. One that gets returned from the Get Items SharePoint action. I'm trying to get to a list of emails like what you were doing but the column I'm getting these email values from is a people column with multi select enabled. In looking at the object that comes from the Get Items action, what I'm trying to get to is Object -> body -> value -> PeopleColumn -> Email. I just want to get a list of these emails so I can use them in a CC of an email. Any suggestions?

    • @DamoBird365
      @DamoBird365  Рік тому

      You want to use select in text mode, then a join in the result. See here JSON Arrays in Power Automate: Learn Common Techniques & Solve 5 Challenges!
      ua-cam.com/video/G3Q1WuZTWuY/v-deo.html

    • @kurthenderson6848
      @kurthenderson6848 Рік тому

      @@DamoBird365 Thank you for responding. I checked out the video and understand the method but it does not work for my scenario because what I'm trying to get to is two layers deep. I can use the select statement to get to the multi select people column and that returns an array of all of the people for that record I'm looking at but I can't get to their email address in that array. I keep getting the error that the Email cannot be selected because array element require a integer index. I can share the redacted array returned from the select action item if that helps.

    • @kurthenderson6848
      @kurthenderson6848 Рік тому

      ​ @DamoBird365 I figured out what the issue / difference was. For a SharePoint people picker column, when you make that column multi-select, it changes how it stores the data from an object to an array of objects. In order to get to the emails you need to use two nested apply to each actions. What a pain. Search "Get items for each user in multiple people picker field (Power Automate)" to get to the article that cleared it up for me. Maybe there is a more efficient way to do this but at least it works.
      👍

    • @darkwraithcovenantindustries
      @darkwraithcovenantindustries 8 місяців тому

      I'm having this exact same problem, but w forms. This would be trivial to do in C# or Powershell, but its a total nightmare to do in Power Automate. The nested replace method to clear out the formatting from the multi-select output is rather terrible. @@kurthenderson6848 My issue is a I have a multi-select form, with 4 users and an array with the 4 users and their emails. I am trying to figure out how to build a CC list that matches up the name-email parts as well for recipients of an email that collects the form responses. I'll check out that article thank you.

  • @parranoic
    @parranoic Рік тому +1

    Thank you, I was pulling my hair out. You saved me from a nasty call tomorrow.

    • @DamoBird365
      @DamoBird365  Рік тому +1

      Hey Don, anytime. Hope you’re sorted. 👍

    • @parranoic
      @parranoic Рік тому +1

      @@DamoBird365 yes, thank you so much. You really gave me the base I needed to build and improve my existing flows.

    • @DamoBird365
      @DamoBird365  Рік тому +1

      If you’re looking to learn more about arrays and efficiency, check out 👀 Unlock the Power of Arrays in Power Automate: Learn Common Techniques & Solve 5 Challenges!
      ua-cam.com/video/G3Q1WuZTWuY/v-deo.html

  • @btoz6237
    @btoz6237 Рік тому +1

    Great video , thank you 👍🏼

    • @DamoBird365
      @DamoBird365  Рік тому +1

      Did you see my other video on json ua-cam.com/video/G3Q1WuZTWuY/v-deo.html

    • @btoz6237
      @btoz6237 Рік тому +1

      @@DamoBird365 Not yet .. but I'm watching your other one about Repurposing the array to grab unique values which I need to do, and that one is great as well. thank you. Such a big learning curve here for someone new to Power Automate. thanks again

  • @marisapiratelli2632
    @marisapiratelli2632 3 роки тому +1

    Thanks a lot! That was very useful!

    • @DamoBird365
      @DamoBird365  3 роки тому +1

      No problems Marisa, really glad it was of help. 👍

  • @moserbua
    @moserbua 2 роки тому +1

    very very useful, thank you so much ! subscribed as well :)

    • @DamoBird365
      @DamoBird365  2 роки тому +1

      Cheers Hannes, if you’ve got any video ideas, feel free to email me ideas@damobird365.com

  • @zobiriyoucef2780
    @zobiriyoucef2780 3 роки тому

    Thanks a lot, you save my Day

  • @shahbaazansari8227
    @shahbaazansari8227 2 роки тому +1

    Awesome

  • @rameshbabuc5981
    @rameshbabuc5981 2 роки тому

    Thanks for this Detailed example. Using Power Automate I am doing following operations as per requirement.
    Trigger condition : When email trigger with csv attachment
    - In .CSV file there is no empty row in between content
    - Using select operations mapping key and value pairs.
    But after execution of select operation , in output I am seeing empty value.
    Is there any value to restrict empty row value check in select operation
    "From" option dynamically?
    Also Parse JSON is failing due to empty , so I added "null" value in Parse JSON scheme.
    After adding this value , I could not see return values(Name,Date,Email) from csv
    Kindly help.

    • @DamoBird365
      @DamoBird365  2 роки тому

      Hi there, you can use the Filter Array action to remove null rows, where value not equal to '' or null. Also, in your expression, do you include ? in the path. e.g. triggerbody()?['value'] will return null if not found, whereas triggerbody()['value'] will cause your flow to fail if the value is not returned in your JSON array. Therefore trying adding ? to your expression.

  • @gigibuffon11
    @gigibuffon11 2 роки тому

    Hi, thank you for this video. It has really help me a lot. One question when you iterate to give you all emails the output is an array of all emails. How can I change that instead of returning a array with all email can return a simple text with all emails?

    • @DamoBird365
      @DamoBird365  2 роки тому

      Once you have that array of emails, simply use the expression JOIN() on the array. It will join those values based on another string. For instance join(SelectOutput,';') which will give you a semicolon separated list of emails.

    • @gigibuffon11
      @gigibuffon11 2 роки тому

      @@DamoBird365 Thank you for the respond. I was trying in service now to view it as a list but the '
      ' doesnt seems to work. Dont know if you have a solution for that! Thanks again!

  • @michaelwaxman2067
    @michaelwaxman2067 2 роки тому

    I would like to take your last step, List All Emails from Array, and use that for a similar flow store each IMAGE URL from my array to a separate field on a Sharepoint list. I need each URL to be in a separate field because my next step is to Populate a Word Document, where I will Get Content from each URL and save it to a distinct Word QuickPart field. How would I handle this, and is it the correct approach? Thank you!

    • @DamoBird365
      @DamoBird365  2 роки тому

      Hey Michael. I would have said that you would need to have a column for each url, will that be fixed or at least limited to a maximum number? You can then use an apply to each and a compose to get the file content and create another array outside the apply to each using outputs(), known as Pieter technique which I demo in latest video. You can then call them by integer value from your array. Ie ?[0]. Word doesn’t support repeating parts for images but if they are in fixed positions I guess it will work. What’s your use case? Sounds interesting.

    • @michaelwaxman2067
      @michaelwaxman2067 2 роки тому

      @@DamoBird365 Thanks for replying! Yes, I have 3 arrays, with a maximum of 5 images each. My use case specifically is I'm capturing survey data using Microsoft Forms, which allows for attachment reponses, but drops them into arrays automatically. I then store that data directly to a Sharepoint list where my team does qa work (one of those tasks being to check each image). After QA is complete, I replicate the clean data out to my client sites and generate an executive summary for each survey in Word/PDF format, and would like to include the images in the summary doc. Correct, repeating parts is the big hangup here. I've been looking at initializing distinct variables for the 15 images, and as you said loading a corresponding index value from the array to each variable, but it seems like I would need a condition on each loop to make sure I'm grabbing an index number that exists in the array. I will check out the Pieter technique, but it sounds like I'm not that far off.. woohoo!

    • @DamoBird365
      @DamoBird365  2 роки тому

      @@michaelwaxman2067 if you get stuck, drop me an email ideas@damobird365.com. 👍 sounds like an interesting solution.

  • @jaggyjut
    @jaggyjut Рік тому

    Thanks. What if we have a xls file with property attributes like rent,address,no of bedrooms. How can we convert this into an json array pls. I’m trying to use this json in adobe doc generation api to create a table from the json array.

    • @DamoBird365
      @DamoBird365  Рік тому

      If it’s 2003 xls, I’m not aware of any method to convert. If it’s xlsx, you can use office scripts if no table.

  • @rajnishrajput2367
    @rajnishrajput2367 2 роки тому

    Thanks for detailed video
    I am trying to export data from Power BI Report to CSV which contains a date field and the formatting of date is 2004-01-14T18:30:00.000Z like this instead of dd-mm-yyyy. Is there a way to format a field in the array?

    • @DamoBird365
      @DamoBird365  2 роки тому +2

      Formatdatetime www.damobird365.com/formatdatetime-and-formatting-a-string-date/

  • @shaniapereira3973
    @shaniapereira3973 3 роки тому

    i want to know how to sort array elements in descending order.

    • @DamoBird365
      @DamoBird365  3 роки тому

      Not so easy in Power Automate, albeit you can use office scripts or a custom connector written in c#. I might do my end version of a video if there’s enough interest.

  • @ga43ga54
    @ga43ga54 3 роки тому

    Hi,
    I am getting the below error, can you please help.
    The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['entity']?['Power BI values']' is of type 'Null'. The result must be a valid array.

    • @DamoBird365
      @DamoBird365  3 роки тому

      Powerautomate will return null if the object doesn’t exist when using ? In the expression. I would take a look at your trigger body history output, check the entity and power bi values path.

  • @shiferaw100
    @shiferaw100 2 роки тому

    I have a question on reading Excel file from OneDrive Busisness. When I use List rows Present in a Table, however, when I upload a new file, it reads the old data. Is there any best way to read from Excel stored from OneDrive to SQL?

    • @DamoBird365
      @DamoBird365  2 роки тому

      If you use the trigger when a file is created, you should be able to dynamically reference the new file. I’ve no experience of importing data into sql. Maybe try the forum powerusers.microsoft.com/

    • @shiferaw100
      @shiferaw100 2 роки тому

      @@DamoBird365 Thank you for your response. I use when file is created, but it always read from Cache. The issue is from the read side, the SQL part works perfect. I will try the forum.

  • @vamshireddy5367
    @vamshireddy5367 4 місяці тому +1

    This is great and helpful, In my case I want to extract the child value("value": "386") inside an element, but I’m getting blank value when I pass the attribute name(value) but getting the value (926) when I pass the objectTypeAttributeId.
    {
    "workspaceId": "",
    "globalId": "",
    "id": "123233",
    "objectTypeAttribute": {
    "workspaceId": "",
    "globalId": "",
    "id": "926",
    "name": "ID",
    "label": false,
    "type": 0,
    "description": "",
    "defaultType": {
    "id": 0,
    "name": "Text"
    },
    "editable": true,
    "system": false,
    "sortable": true,
    "summable": false,
    "indexed": true,
    "minimumCardinality": 0,
    "maximumCardinality": 1,
    "removable": true,
    "hidden": false,
    "includeChildObjectTypes": false,
    "uniqueAttribute": false,
    "options": "",
    "position": 0
    },
    "objectTypeAttributeId": "926",
    "objectAttributeValues": [
    {
    "value": "386",
    "displayValue": "386",
    "searchValue": "386",
    "referencedType": false
    }
    ],
    "objectId": "2524"
    }

    • @DamoBird365
      @DamoBird365  4 місяці тому

      386 is the first object {} with key name value of the objectattributevalues array [] first(output(‘compose’)?[‘objattvalue’])?[‘value’]

  • @billypham3024
    @billypham3024 Рік тому +1

    great video. I have a question that I got a result from Power Automate like this and I just want to get name only, how do I do that? See a result "Business Owner:[{"_id":"4101FD8D-xds-dfsg-ABD2-3B960FE2050A","_type":"Person","name":"Rick, Brown"}]. Thank you

    • @DamoBird365
      @DamoBird365  Рік тому

      Looks like your business owner is an array [] and therefore you want to get the first() Business Owner and then the name field. Something like first(expression to business owner)?['name']

  • @Wzxxx
    @Wzxxx 5 місяців тому +1

    What if i would like to select only selected keys(columns) and corresponding values from a initial array ie. I would like to have and array of names and emails. (I have a http request which result od 160 columns and i need only some of them)?

    • @DamoBird365
      @DamoBird365  5 місяців тому

      That’s exactly what select can do for you but sometimes you can limit the columns returned by the api too, like graph. Check out ua-cam.com/video/afqvGAb20Dw/v-deo.htmlsi=XjII21bFGrC6atyM

    • @Wzxxx
      @Wzxxx 5 місяців тому +1

      @@DamoBird365 thank You very much for the answer and the whole content. Will watch it for sure. Great tutorials! Help me a lot so far