Discussion

Comparing Function for valueList

Hi,
Can any please guide me on this ..

I have embedded pages on clipboard

apple-
ap(1)
Key = a
IG = ?
ap(2)
Key = b
IG = ?
ap(3)
Key = c
IG = ?
ap(4)
Key = b
IG = ?

Now each embedded page has key and IG ...
I want to loop thorough these embedded pages so that whenever
Key is unique set IG = 0 and when Key has duplicate value set IG = 1
(like ap(4) is has duplicate so it should set IG as 1).

I am trying to achieve this through valuelist .but dont know what what fuction should i use in precondition to achieve this

kindly help

Regards
Jatin S

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

February 22, 2011 - 9:40am

Set up a temporary clipboard page with a value group. Use the value group to keep track of which values you've already seen.

Rob Dunie

quote:


Originally posted by JATINSEHGAL

Hi,
Can any please guide me on this ..

I have embedded pages on clipboard

apple-
ap(1)
Key = a
IG = ?
ap(2)
Key = b
IG = ?
ap(3)
Key = c
IG = ?
ap(4)
Key = b
IG = ?

Now each embedded page has key and IG ...
I want to loop thorough these embedded pages so that whenever
Key is unique set IG = 0 and when Key has duplicate value set IG = 1
(like ap(4) is has duplicate so it should set IG as 1).

I am trying to achieve this through valuelist .but dont know what what fuction should i use in precondition to achieve this

kindly help

Regards
Jatin S


April 10, 2012 - 6:22am

Hi,

declare local variable called keys as string

Iterate ur embedded page.

1. check current key is in keys if there set IG=1
else IG=o and append ur key with keys

It will resolve ur pblm.

You can have it as a java code or activity steps.

Let me know if u have any pblm on this same.

Regards
Alagar.

April 11, 2012 - 2:48pm

1)Pre assume that all are unique and initialize the IG to 0

2)Now iterate through Page List
Pre Condition 1 If IG == 1 exit this iteration else continue whens
Condition 2
@IsInPageList(.Key,"IG","apple.ap") --> true Property-Set IG to 1
---> false exit this iteration

A little difference you will see in the output of final list,shown below

apple-
ap(1)
Key = a
IG = 0
ap(2)
Key = b
IG = 1
ap(3)
Key = c
IG = 0
ap(4)
Key = b
IG = 0

But not as you expected

apple-
ap(1)
Key = a
IG = 0
ap(2)
Key = b
IG = 0
ap(3)
Key = c
IG = 0
ap(4)
Key = b
IG = 1
If the proposed output also works for you you can use the solution. or else robert.dunie solution also looks good.

Thanks
Chiranjeevi

quote:


Originally posted by JATINSEHGAL

Hi,
Can any please guide me on this ..

I have embedded pages on clipboard

apple-
ap(1)
Key = a
IG = ?
ap(2)
Key = b
IG = ?
ap(3)
Key = c
IG = ?
ap(4)
Key = b
IG = ?

Now each embedded page has key and IG ...
I want to loop thorough these embedded pages so that whenever
Key is unique set IG = 0 and when Key has duplicate value set IG = 1
(like ap(4) is has duplicate so it should set IG as 1).

I am trying to achieve this through valuelist .but dont know what what fuction should i use in precondition to achieve this

kindly help

Regards
Jatin S