# How to process the json like properties list output by eggplant command?

**URL:** <https://forums.eggplantsoftware.com/t/how-to-process-the-json-like-properties-list-output-by-eggplant-command/8462>\
**Category:** Uncategorized\
**Created:** [May 26, 2023, 7:52am UTC](https://forums.eggplantsoftware.com/t/how-to-process-the-json-like-properties-list-output-by-eggplant-command/8462 "2023-05-26T07:52:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thanagaraj](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/t/e495f1/32.png) [@Thanagaraj](https://forums.eggplantsoftware.com/u/Thanagaraj)\
**Post date:** [May 26, 2023, 7:52am UTC](https://forums.eggplantsoftware.com/t/how-to-process-the-json-like-properties-list-output-by-eggplant-command/8462/1 "2023-05-26T07:52:11Z")

</div>

Hello Team,

I have used to CompareScreen feature to valid few screen layout.  
I am getting output as below.

command:  
log “diff”:CompareScreen (“Resourcedemand\_Header”, rect:[“Demand/Header\_TL”,“Demand/Header\_BL”])

Output:

Log Resourcedemand\_Header\_0035.png Found 1 differences  
5/26/23, 9:35:34 AM Log {diff:[{difference:“Changed”, differenceType:“Text”, rectangle:[20,67,217,109], source:“Combined”, text:“YAP Version v”, textNow:“000 Version”}]}

From that How to extreact the textNow value alone without using repeat loop.

Another output:

Log C:/BRAIN\_2\_0/Test.suite/Results/Fullscreen\_compare/20230526\_094642.846/project5555062021\_0039.png Found 2 differences  
5/26/23, 9:47:32 AM Log {diffs:[{difference:“Changed”, differenceType:“Text”, rectangle:[227,43,1616,64], source:“Combined”, text:“^s://10.139A73:444/reports/BSTCockpitChart/ee674c32-1f46-4011-bb79-0b67c505a762?reportld=90dcc303-62bf-4cfb-befb-410b899e5257&returnUrl=%2Freports%2FHistory%2Fee674c32-1f46-4011-bb79-0b67c505a762⏎”, textNow:“M^s://10.139A73:444/reports/BSTCockpitChart/ee674c32-1f46-4011-bb79-0b67c505a762?reportld=90dcc303-62bf-4cfb-befb-410b899e5257&returnUrl=%2Freports%2Fhistory%2Fee674c32-1f46-4011-bb79-0b67c505a762⏎”},{difference:“Changed”, differenceType:“Text”, rectangle:[1860,1056,1911,1073], source:“Combined”, text:“&18AM”}]}

from above property I need to extract textNow and text:

Is there any way quickly extarct the info without using repeat loop?

---

<div class="post-metadata">

**Author:** ![DaveHester](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/davehester/32/104_2.png) [@DaveHester](https://forums.eggplantsoftware.com/u/DaveHester)\
**Post date:** [May 26, 2023, 5:42pm UTC](https://forums.eggplantsoftware.com/t/how-to-process-the-json-like-properties-list-output-by-eggplant-command/8462/2 "2023-05-26T17:42:55Z")

</div>

Your output is going to be a list of property lists with a separate item for each difference. A very efficient way of extracting a single key value from within each item involves a repeat loop.

```auto
CompareScreen "tutorialSUT_whole"
put the result into TSW_results
Repeat with each item myDifference of TSW_results
	If myDifference.TextNow is not empty then put "The current text is now" && myDifference.TextNow
End Repeat

```

Is there a specific reason why your use case prohibits repeat loops?

---

<div class="post-metadata">

**Author:** ![Vijayalaxmi](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/v/e19b73/32.png) [@Vijayalaxmi](https://forums.eggplantsoftware.com/u/Vijayalaxmi)\
**Post date:** [July 26, 2023, 5:39am UTC](https://forums.eggplantsoftware.com/t/how-to-process-the-json-like-properties-list-output-by-eggplant-command/8462/3 "2023-07-26T05:39:22Z")

</div>

We can try to get the text and textNow values with the below code without using repeat Loop.  
put CompareScreenDiff into CSDiff  
put CSD as propertylist into PCSDiff  
put PCSDiff.diffs into Differences.  
put first item of Differences into Diff  
log “Text Now”&&“------------------”&&Diff.textNow  
log “Text”&&“------------------”&&Diff.text
