web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help Needed: Error Whi...
Power Automate
Unanswered

Help Needed: Error While Creating CSV Table from Filtered Array (Pods/Pictures)

(0) ShareShare
ReportReport
Posted on by

Hi Power Automate Community,

 

I'm facing an issue while working with a filtered array of delivery objects. My goal is to extract the pods.pictures from each delivery's trackingData and generate a CSV table.

 

Here’s a brief overview of my flow:

1) filter array given below output
===========
[
{
"type": "delivery",
"orderId": "a75dfbe8-fde9-452c-a9dc-92fcded9cdb4",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "40523",
"startSec": "40523",
"endSec": "41947",
"driveToNextSec": "-1",
"distanceToNextMt": "-1",
"stopIdx": "1",
"displayLabel": "1.1",
"trackingLink": "https://l-nk.io/WdJEWYN",
"trackingData": {
"driverId": "d1731329-2420-4de2-b5f0-0abcd1778b82",
"vehicleId": "71538fd8-47c5-4b5b-b0af-494b1e4ea1d3",
"timeInSec": "40620",
"timeInLatLng": [
"39927583",
"-105042349"
],
"timeOutSec": "41880",
"timeOutLatLng": [
"39927617",
"-105041746"
],
"status": "done",
"statusSec": "41890",
"statusLatLng": [
"39927632",
"-105041850"
],
"statusReason": null,
"timeInDetectedSec": "40523",
"timeInDetectedLatLng": [
"39927713",
"-105042102"
],
"timeOutDetectedSec": "41947",
"timeOutDetectedLatLng": [
"39927701",
"-105040564"
],
"trackedLoadMap": null,
"trackedCustomFieldMap": null,
"pods": {
"pictures": {
"4a40069f-e1bb-4909-9da9-cc10ece39fa6": {
"sec": "41973",
"latLng": [
"39927907",
"-105040668"
],
"text": "",
"token": "20250710-60d610de-00604b6e.jpg"
},
"ab1b0911-bf60-418d-b552-b53b56357966": {
"sec": "41973",
"latLng": [
"39927907",
"-105040668"
],
"text": "",
"token": "20250710-60d610de-c08ffae2.jpg"
},
"c3f3b4ad-a7ba-4315-8865-322917821eda": {
"sec": "41973",
"latLng": [
"39927907",
"-105040668"
],
"text": "",
"token": "20250710-60d610de-434d835c.jpg"
},
"c03c4cf1-cc7b-4876-8677-bd0be3e3893d": {
"sec": "41973",
"latLng": [
"39927907",
"-105040668"
],
"text": "",
"token": "20250710-60d610de-6fb4d598.jpg"
}
}
}
}
},
{
"type": "delivery",
"orderId": "2576e493-80b4-4984-804f-a85273d2ed6b",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "43353",
"startSec": "43353",
"endSec": "43810",
"driveToNextSec": "-1",
"distanceToNextMt": "-1",
"stopIdx": "2",
"displayLabel": "1.2",
"trackingLink": "https://l-nk.io/7lbJb3P",
"trackingData": {
"driverId": "d1731329-2420-4de2-b5f0-0abcd1778b82",
"vehicleId": "71538fd8-47c5-4b5b-b0af-494b1e4ea1d3",
"timeInSec": "43443",
"timeInLatLng": [
"40018027",
"-105087557"
],
"timeOutSec": "43758",
"timeOutLatLng": [
"40017975",
"-105087578"
],
"status": "done",
"statusSec": "43757",
"statusLatLng": [
"40017975",
"-105087578"
],
"statusReason": null,
"timeInDetectedSec": "43353",
"timeInDetectedLatLng": [
"40018202",
"-105087489"
],
"timeOutDetectedSec": "43810",
"timeOutDetectedLatLng": [
"40017527",
"-105088630"
],
"trackedLoadMap": null,
"trackedCustomFieldMap": null,
"pods": {
"pictures": {
"f550fbec-abac-4865-862b-b06e226ff714": {
"sec": "43820",
"latLng": [
"40017250",
"-105089119"
],
"text": "",
"token": "20250710-60d610de-367be765.jpg"
},
"66e79dcd-e3ee-41f0-baf1-266fc78eb8e7": {
"sec": "43820",
"latLng": [
"40017250",
"-105089119"
],
"text": "",
"token": "20250710-60d610de-a6d5fd47.jpg"
},
"8fea88c4-5a8f-4045-87f2-636428afea1e": {
"sec": "43820",
"latLng": [
"40017250",
"-105089119"
],
"text": "",
"token": "20250710-60d610de-5e13afe6.jpg"
},
"a5334a58-09c7-4a68-98c3-f9492e9d7e25": {
"sec": "43820",
"latLng": [
"40017250",
"-105089119"
],
"text": "",
"token": "20250710-60d610de-bdac9f83.jpg"
}
}
}
}
},
{
"type": "delivery",
"orderId": "91d3bf2a-204f-4ca3-9e4d-969d4451079b",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "44204",
"startSec": "44204",
"endSec": "46904",
"driveToNextSec": "1782",
"distanceToNextMt": "33620",
"stopIdx": "3",
"displayLabel": "1.3",
"trackingLink": null,
"trackingData": {
"driverId": "d1731329-2420-4de2-b5f0-0abcd1778b82",
"vehicleId": "71538fd8-47c5-4b5b-b0af-494b1e4ea1d3",
"timeInSec": "44244",
"timeInLatLng": [
"40035438",
"-105082236"
],
"timeOutSec": "-1",
"timeOutLatLng": null,
"status": null,
"statusSec": "-1",
"statusLatLng": null,
"statusReason": null,
"timeInDetectedSec": "44204",
"timeInDetectedLatLng": [
"40035300",
"-105082205"
],
"timeOutDetectedSec": "-1",
"timeOutDetectedLatLng": null,
"trackedLoadMap": null,
"trackedCustomFieldMap": null,
"pods": null
}
},
{
"type": "delivery",
"orderId": "212fac46-b212-469c-998a-e30e9fc2729c",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "48686",
"startSec": "48686",
"endSec": "49886",
"driveToNextSec": "2020",
"distanceToNextMt": "45098",
"stopIdx": "4",
"displayLabel": "1.4",
"trackingLink": "https://l-nk.io/1yQV4yf"
},
{
"type": "delivery",
"orderId": "8d6a734d-063c-4260-9d24-eecdaa098bfe",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "51906",
"startSec": "51906",
"endSec": "53106",
"driveToNextSec": "540",
"distanceToNextMt": "4298",
"stopIdx": "5",
"displayLabel": "1.5",
"trackingLink": "https://l-nk.io/Y7KHPHV"
},
{
"type": "delivery",
"orderId": "79d82db0-f127-4bdf-aab2-2ea3f279e0b6",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "53646",
"startSec": "53646",
"endSec": "54846",
"driveToNextSec": "1623",
"distanceToNextMt": "36677",
"stopIdx": "6",
"displayLabel": "1.6",
"trackingLink": "https://l-nk.io/vHybSHh"
},
{
"type": "delivery",
"orderId": "b6d2a695-309b-4bec-b35e-616859add95a",
"idleTimeSec": "4731",
"perStopTimeSec": "0",
"arrivalSec": "56469",
"startSec": "61200",
"endSec": "62400",
"driveToNextSec": "2132",
"distanceToNextMt": "51539",
"stopIdx": "7",
"displayLabel": "1.7",
"trackingLink": "https://l-nk.io/hNbbc9N"
},
{
"type": "delivery",
"orderId": "db784a86-e97d-443c-8141-4f2663c47f73",
"idleTimeSec": "0",
"perStopTimeSec": "0",
"arrivalSec": "64532",
"startSec": "64532",
"endSec": "66632",
"driveToNextSec": "392",
"distanceToNextMt": "3235",
"stopIdx": "8",
"displayLabel": "1.8",
"trackingLink": "https://l-nk.io/ofEibXw"
}
]

my flow strcture is
2) apply to each 4 - trackingData
@{body('Filter_array')}

3) Compose 3 - POD
@{items('Apply_to_each_4_-_trackingData')?['trackingData']?['pods']}

4) Create CSV table
@{createArray(outputs('Compose_3_-_POD').pictures)}

5) Select 3
From
------------
@{split(
first(
split(
body('Create_CSV_table'),
decodeUriComponent('%0D%0A')
)
),
','
)}

Map:
---------
@outputs('Compose_3_-_POD').pictures[item()]


in apply to each loop this error
ActionFailed. An action failed. No dependent actions succeeded.

but in 3 to 8 number object

in csv table step
--------------
InvalidTemplate. Unable to process template language expressions in action 'Create_CSV_table' inputs at line '0' and column '0': 'The template language expression 'createArray(outputs('Compose_3_-_POD').pictures)' cannot be evaluated because property 'pictures' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

in select 3 step
--------------------
ActionConditionFailed. The execution of template action 'Select_3' is skipped: the 'runAfter' condition for action 'Create_CSV_table' is not satisfied. Expected status values 'Succeeded' and actual value 'Failed'.

  1. Filter Array – Filtering delivery objects from a JSON array.

  2. Apply to Each (Apply_to_each_4 - trackingData) – Iterates over the filtered array:
    @{body('Filter_array')}

  3. Compose 3 - POD – Extracts the pods object:
    @{items('Apply_to_each_4_-_trackingData')?['trackingData']?['pods']}

  4. Create CSV Table – Trying to access pictures:

    @{createArray(outputs('Compose_3_-_POD').pictures)}
     

  5. Select 3 – Attempts to map data from pictures using split logic.

Issue:

  • The flow fails at Create CSV Table with the error:

    InvalidTemplate. Unable to process template language expressions in action 'Create_CSV_table' inputs... because property 'pictures' cannot be selected.
     

  • In Apply to Each, it shows: yaml
    ActionFailed. An action failed. No dependent actions succeeded.
     

  • And Select 3 is skipped due to the previous failure.

    My observations:

  • Items 3 to 8 in the original array don't have pods or pictures — they are either null or missing.

    • I suspect the flow breaks when trackingData.pods or pictures is not available in some items.
      ​​​​​​​

       

      Question:

      How can I safely extract only those pods.pictures that exist and avoid breaking the flow when they are missing?

      Any guidance, workaround, or sample expression to skip null or missing fields would be highly appreciated.

      Thanks in advance!

       

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,695 Super User 2025 Season 2 on at
     
    Hi,
     
    Thanks for providing the sample data. I did find the text hard to understand, but we can work through it step-by-step.
     
    You can filter out null values for the picture property using:
     
     
     
     
     
    Ellis Karim
    Ellis Karim
    Blog | LinkedIn | Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!
     
     
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    With your Filter result in the initial Compose:
    xpath(
    	xml(
    		addProperty(
    			json('{}'),
    			'Root',
    			addProperty(
    				json('{}'),
    				'Item',
    				outputs('Compose')
    			)
    		)
    	),
    	'/Root/Item/trackingData/pods/pictures/*'
    )
    json(item())[
    	if(
    		startsWith(
    			xpath(
    					item(),
    					'name(/*)'
    				),
    			'_x003'
    		),
    		concat(
    			slice(
    				xpath(
    					item(),
    					'name(/*)'
    				),
    				5, 6
    			),
    			slice(
    				xpath(
    					item(),
    					'name(/*)'
    				),
    				7
    			)
    		),
    		xpath(
    			item(),
    			'name(/*)'
    		)
    	)
    ]

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard