I’ve kept it like this for orderInfo:
orderInfo= deseXMLDoc.Root.Descendants(“InvoiceIDInfo”)(0).Attribute(“invoiceID”).Value.ToString
but i also want to include Invoice ID.
Can anyone suggest the answer to it?
I’ve kept it like this for orderInfo:
orderInfo= deseXMLDoc.Root.Descendants(“InvoiceIDInfo”)(0).Attribute(“invoiceID”).Value.ToString
but i also want to include Invoice ID.
Can anyone suggest the answer to it?
Hi @anjasing,
Have you tried using pipe symbol || or may be using Or keyword itself?
Does it work?
Regards
Sonali
@anjasing - I think you can use If logic in an assign statement and achieve it.
Pseudo code
Orderinfo= if ( value equals InvoiceId, get the invoiceid, else get orderId)
Could you please provide a sample like I’ve shown in above… I want both thing into one variable only?
Hi
Use this expression in an assign activity
YourXDocVar.Root.Descendants(“ABC”).ToList
orderInfo= IF(deseXMLDoc.Root.Descendants(“InvoiceIDInfo”).ToList.Contains(“InvoiceID”), deseXMLDoc.Root.Descendants(“InvoiceIDInfo”)(0).Attribute(“invoiceID”).Value.ToString, deseXMLDoc.Root.Descendants(“orderrequestheader”)(0).Attribute(“OrderID”).Value.ToString)
Cheers @anjasing
Can you please suggest what should be type of orderInfo variable here ?
String type @anjasing
it’s giving the error
If you can help here?
Sure
Can I have the xml file if possible
I can give you the flow
@anjasing
Hi,
Here’s the sample file
MainDocument.xml (543 Bytes)
@anjasing - Here you go…
xeInvoiceIDInfo = xDoc.Root.Descendants("InvoiceIDInfo").toList
orderInfo = if(xeInvoiceIDInfo.ElementAt(0).tostring.Contains("invoiceID"),xeInvoiceIDInfo.ElementAt(0).Attribute("invoiceID").Value,xeInvoiceIDInfo.ElementAt(0).Attribute("orderID").Value)
Hope this helps…
Thank you so much
So you have already tested with both orderID and InvoiceID? just making sure…
Hi,
I was able to process for invoice ID but not for orderID…could you please help with this error which I am getting for orderID…
I was loaded with work, so couldn’t check properly
Please send the xml with the orderID.
MainDocument (16).zip (1.4 KB)
Thank you so much for helping
Please check this… orderID and InvoiceID are using two different desendants…So I created another List for OrderID, Please see below…
xeOrderIDInfo = xDoc.Root.Descendants("OrderRequestHeader").toList
orderInfo = if(xeInvoiceIDInfo.count > 0,xeInvoiceIDInfo.ElementAt(0).Attribute("invoiceID").Value,xeOrderIDInfo.ElementAt(0).Attribute("orderID").Value)
Output for InvoiceID
Hope this helps…
Yeah, It is working perfectly fine for both…Thank you soo much
Hi prasath17,
I needed a help…
it is giving Object reference not set to an instance of an object…when there is only invoice id or only order id? Can u plz help