Hi there,
This is my xml script. I want to ask is there any ways to read in elements flag → pfv based on pfSeqNo.
For example, I want the output of ADMINSTRATION based on the pfSeqNo 3.
I appreciate any reply from you. Thanks and best regards.
Hi,
The following steps might help you.
1.Get pf element. (pf as XElement)
2.Get all item Elements as IEnumerable using Descendants method.
itemList = pf.Descendants("item")
3.Iterate above collection and get pfsrqNo Element and pfv Element each item Element (using Descendants method etc).
for each item in itemList
pfsqNo = item.Descendants("pfsrqNo").First
pfv= item.Descendants("pfv").First
4.If necessary,use Dictionary to link pfseqno and pfv.
dictionary(pfseqno.Value.toString.trim) = pfv.Value.toString
Then you can get the value as dictionary(“3”)
Regards,
Hi @AshwinS2
I got to run out the results, but the problem is my xml file having similar nodes, that’s why I can’t extract it using their nodes. So how am I going to run out all data based on their pfSeqNo?
Hi @yushinchan
Use deserialize xml activity and pass the values in add to dictionary activity and check the value
Thanks
Ashwin.S
Hi,
You need to create and initialize Dictionary instance.
I’ll attach modified xaml file as the following.
test.xaml (8.8 KB)
Regards,
Hi @Yoichi
Thanks for your workflow. I have tried your workflow and I wonder what’s this error? And how am I going to modify it?
Hi,
Can you check if pfsqNo and pfv have value using breakpoint in Debug mode?
Or can you share your xml file, because I cannot check if it works good? (It’s no problem if they are dummy data.)
Regards,
Hi @Yoichi
It’s work :') But is it possible if I want to extract only some item from all these items?
For example, I only want to extract Company Name, Occupation and Consent for Direct Marketing?
Thanks and best regards.
Hi,
You can do it using If activity if my understanding is right.
Hope the following might help you.
test.xaml (11.5 KB)
Regards,
Hi @Yoichi
Do help me a lot. Thanks so much :')
Can help me look through another questions?
Thanks and best regards.