# How to compare unordered property list value?

**URL:** <https://forums.eggplantsoftware.com/t/how-to-compare-unordered-property-list-value/8368>\
**Category:** Uncategorized\
**Created:** [March 16, 2023, 9:09am UTC](https://forums.eggplantsoftware.com/t/how-to-compare-unordered-property-list-value/8368 "2023-03-16T09:09:47Z")\
**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:** [March 16, 2023, 9:09am UTC](https://forums.eggplantsoftware.com/t/how-to-compare-unordered-property-list-value/8368/1 "2023-03-16T09:09:47Z")

</div>

Hello Team,  
I have the below code for entering the task name and random valueclick  
put ““TaskName\_0” as task\_name  
put 1 as number into global version\_number  
typetext task\_name  
typetext tab  
put random(1,20) into downarrow\_press  
typetext downArrow repeated downarrow\_press times  
wait 2  
typetext returnkey  
wait 2  
typetext tab  
put task\_name into global task\_info.task\_name  
put global version\_number into global task\_info.version  
log global task\_info  
repeat 12 times  
put format(”%.2f",random(0,20000)/1000) into task\_value  
replace “.” with “,” in task\_value  
typetext task\_value  
typetext tab  
put “Demand”&repeatindex() into demand\_value  
put task\_value into global task\_info.(demand\_value)  
end repeat  
insert global task\_info into global task\_details  
log “Current version Entered Value:”&&global task\_detailss.

The o/p of the first iteration:  
[{Demand1:“3,72”, Demand10:“2,38”, Demand11:“1,26”, Demand12:“5,53”, Demand2:“3,43”, Demand3:“5,43”, Demand4:“17,80”, Demand5:“9,38”, Demand6:“16,00”, Demand7:“14,08”, Demand8:“8,43”, Demand9:“8,07”, task\_name:“TaskName\_0”, version:1}]

While query the DB:

[{Demand01:“3.72”, Demand02:“3.43”, Demand03:“5.43”, Demand04:“17.80”, Demand05:“9.38”, Demand06:“16.00”, Demand07:“14.08”, Demand08:“8.43”, Demand09:“8.07”, Demand10:“2.38”, Demand11:“1.26”, Demand12:“5.53”, TaskName:“TaskName\_0”, version:“1”}]

How to ensure these Two property list are same?

The next iteartion

The acumualted entered value is as below

[{Demand1:“3,72”, Demand10:“2,38”, Demand11:“1,26”, Demand12:“5,53”, Demand2:“3,43”, Demand3:“5,43”, Demand4:“17,80”, Demand5:“9,38”, Demand6:“16,00”, Demand7:“14,08”, Demand8:“8,43”, Demand9:“8,07”, task\_name:“TaskName\_0”, **version:1** },{Demand1:“18,54”, Demand10:“5,84”, Demand11:“10,52”, Demand12:“0,63”, Demand2:“0,29”, Demand3:“13,55”, Demand4:“16,67”, Demand5:“4,25”, Demand6:“14,43”, Demand7:“1,48”, Demand8:“13,28”, Demand9:“0,80”, task\_name:“taskname\_1”, version:2}]

How to update the version number in the accumulated result of intial version data so that I can compare my current version DB data?

[{Demand01:“3.72”, Demand02:“3.43”, Demand03:“5.43”, Demand04:“17.80”, Demand05:“9.38”, Demand06:“16.00”, Demand07:“14.08”, Demand08:“8.43”, Demand09:“8.07”, Demand10:“2.38”, Demand11:“1.26”, Demand12:“5.53”, TaskName:“TaskName\_0”, version:“2”},{Demand01:“18.54”, Demand02:“.29”, Demand03:“13.55”, Demand04:“16.67”, Demand05:“4.25”, Demand06:“14.43”, Demand07:“1.48”, Demand08:“13.28”, Demand09:“.80”, Demand10:“5.84”, Demand11:“10.52”, Demand12:“.63”, TaskName:“taskname\_1”, version:“2”}]

Regards  
D.Thangaraj

---

<div class="post-metadata">

**Author:** ![SenseTalkDoug](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/sensetalkdoug/32/88_2.png) [@SenseTalkDoug](https://forums.eggplantsoftware.com/u/SenseTalkDoug)\
**Post date:** [March 27, 2023, 8:00pm UTC](https://forums.eggplantsoftware.com/t/how-to-compare-unordered-property-list-value/8368/2 "2023-03-27T20:00:51Z")

</div>

Probably the simplest approach will be to generate the keys and values in the same format that they are in when coming from the database.

Add this line sometime before the repeat loop:  
`set the numberFormat to "00"`

That will make `put “Demand”&repeatindex() into demand_value` generate keys like `Demand03` instead of `Demand3`.

Then delete this line - `replace “.” with “,” in task_value` - so the values will match the ones in the database and I think the comparison will work correctly.

---

<div class="post-metadata">

**Author:** ![alizabetharmstrong](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/a/3bc359/32.png) [@alizabetharmstrong](https://forums.eggplantsoftware.com/u/alizabetharmstrong)\
**Post date:** [April 2, 2023, 7:21pm UTC](https://forums.eggplantsoftware.com/t/how-to-compare-unordered-property-list-value/8368/3 "2023-04-02T19:21:34Z")

</div>

To compare unordered property list values, you can follow these steps:

Convert the property lists to arrays: Convert both property lists into arrays so that their elements can be easily compared.

Sort the arrays: Sort both arrays in ascending or descending order depending on the nature of the values they contain. This step ensures that the elements in both arrays are in the same order and can be compared effectively.

Compare the arrays: Compare the sorted arrays using a built-in function or a custom comparison algorithm. If the arrays have the same elements in the same order, they are considered equal. Otherwise, they are considered unequal. For more details visit here
