# Return query result values in apoc.periodic.iterate

**URL:** <https://community.neo4j.com/t/return-query-result-values-in-apoc-periodic-iterate/59220>\
**Category:** Neo4j Graph Platform\
**Tags:** migrated\
**Created:** [September 28, 2021, 6:29pm UTC](https://community.neo4j.com/t/return-query-result-values-in-apoc-periodic-iterate/59220 "2021-09-28T18:29:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ps1105to](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ps1105to/32/11759_2.png) [@ps1105to](https://community.neo4j.com/u/ps1105to)\
**Post date:** [September 28, 2021, 6:29pm UTC](https://community.neo4j.com/t/return-query-result-values-in-apoc-periodic-iterate/59220/1 "2021-09-28T18:29:37Z")

</div>

Is there a way to return a query result value while using a apoc.periodic.iterate statement?

```auto
call apoc.periodic.iterate ('

UNWIND $input as input

WITH input

MATCH (b:Node1) 
WHERE b.prop1 = input.prop1
AND substring(b.prop2,0,10) = "2021-09-08"

WITH input, b
MATCH (c:Node2 {prop3:b.prop3})

RETURN 
b.prop4 as prop4,
b.prop3 as prop3,
c.prop2 as prop2,
input

','

WITH input, prop4, prop3, prop2
MERGE (a:NodeA {prop1:prop4})

SET a.prop2 = "ABC"
SET a.prop3 = prop3
SET a.prop4 = prop2
SET a.prop5 = input.prop1
SET a.prop6 = input.prop2
SET a.date = "2021-09-09"

FOREACH (
_ IN CASE WHEN input.prop10 = "low" THEN [1] END |
SET a:NodeB
)
FOREACH (
_ IN CASE WHEN input.prop10 <> "low" THEN [1] END |
SET a:NodeC
)
FOREACH (
_ IN CASE WHEN input.error IS NOT NULL OR input.errorCode <> 200 OR input IS NULL THEN [1] END |
SET a:NodeD
SET a.errorCode = input.errorCode
SET a.errorDesc = input.error
)
RETURN input.prop1 as prop1,
input.prop2 as prop2
',
{batchSize:100, parallel:true, params:{input:$input}}
)

```

Would it be possible to get input.prop1 and input.prop2 as a result of the apoc.periodic.iterate statement?

---

<div class="post-metadata">

**Author:** ![akshat\_mittal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshat_mittal/32/4359_2.png) [@akshat\_mittal](https://community.neo4j.com/u/akshat_mittal)\
**Post date:** [October 12, 2022, 6:52am UTC](https://community.neo4j.com/t/return-query-result-values-in-apoc-periodic-iterate/59220/2 "2022-10-12T06:52:26Z")

</div>

Hi Andrew ,

Is it possible now to return property name in periodic iterate statement ??

call apoc.periodic.iterate(" MATCH (n:CONTAINER) WHERE n.MARKFORDEL = 'Y' AND n.EQUIP\_TYPE IN ['MDS']  
WITH n.EQUIP\_NAME AS EN , n.EQUIP\_TYPE AS ET , n.EQUIP\_PKEY AS EP order by EP DESC LIMIT 1  
MATCH (p:PORT) WHERE p.PORT\_CI\_NAME STARTS WITH EN  
WITH DISTINCT EN , EP , p  
return **EN , p.PORT\_CI\_NAME** order by EP DESC", "DETACH DELETE p" , {batchSize:1}) yield batches, total return "DELETION" , batches, total;
