cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jsbev
Frequent Visitor

Access value from array to use as file name

Hi,

 

I have the below array and trying to use the owner name value as the prefix when creating a file for each owner in onedrive. 

 

[
  {
    "@odata.etag": "",
    "ItemInternalId": "cc2f69b4-f257-4f4b-b5da-bb609943309c",
    "Unique identifier": "1",
    "Client segment": "Small investor",
    "Type of PMA": "Private",
    "Owner name": "Tom Spicer",
    "Owner's ph": "02 8888 8888",
    "Owner's email": "AB@hmail.com.au",
    "Owner's name(s)": "Tom Spicer"
  },
  {
    "@odata.etag": "",
    "ItemInternalId": "71174d80-c08e-4487-ad30-25413ccb4f92",
    "Unique identifier": "5",
    "Client segment": "Multi p'pty investor",
    "Type of PMA": "Private",
    "Owner name": "Stephen and Lorraine ",
    "Owner's ph": "0411111111",
    "Owner's email": "AB@hmail.com.au",
    "Owner's name(s)": "Lorraine Hilton and Stephen Hilton"
  
  }
]

 

jsbev_0-1662210135961.png

 

The output should be two text files Tom Spicer.csv and Stephen and Lorraine.csv. 


How can i achieve this please

 

Thanks

Jag

1 ACCEPTED SOLUTION

Accepted Solutions
Kaif_Siddique
Impactful Individual
Impactful Individual

Here is one sample flow to create csv file from array. You have to work on customizations as per your flow. This is just for your reference.

 

Initialize the variable and store output in array

Kaif_Siddique_2-1662225121702.png

 

Now, Apply to each and Create CSV table(--> items('Apply_to_each')['ItemInternalId'] <--)

Kaif_Siddique_3-1662225734219.png

 

Finally, create file based on Owner name (--> items('Apply_to_each')?['Owner name'] <--)

Kaif_Siddique_5-1662226429697.png

 

Let me know if any queries.

 

If you like my response, please give it a Thumbs Up.
If this helps, please Accept as solution.


Regards
Kaif

View solution in original post

3 REPLIES 3
Kaif_Siddique
Impactful Individual
Impactful Individual

Here is one sample flow to create csv file from array. You have to work on customizations as per your flow. This is just for your reference.

 

Initialize the variable and store output in array

Kaif_Siddique_2-1662225121702.png

 

Now, Apply to each and Create CSV table(--> items('Apply_to_each')['ItemInternalId'] <--)

Kaif_Siddique_3-1662225734219.png

 

Finally, create file based on Owner name (--> items('Apply_to_each')?['Owner name'] <--)

Kaif_Siddique_5-1662226429697.png

 

Let me know if any queries.

 

If you like my response, please give it a Thumbs Up.
If this helps, please Accept as solution.


Regards
Kaif

jsbev
Frequent Visitor

Thanks Kaif. I didnt have to create the csv table. The below did the job. Thank you for the support. Much appreciated.

 

working_ownername.png

Kaif_Siddique
Impactful Individual
Impactful Individual

@jsbev use item()?['Owner name'].

 

If you rename "Apply to each" then "items('Apply_to_each')?['Owner name']" will not work. 

Kaif_Siddique_1-1662298527884.png

 

Regards

Kaif

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,475)