test the type of an attribute in document

Hi,
In input I have document which contains some fields (but I know Nothing about this field, I am Jon Snow).
I do a documentToDocumentList with “Name” as name and “Value” as value.
And after that I make a loop on documentList.
I want to test the field Value of my documentList to see if it is a string variable or a Document variable (or a DocumentList variable).
Do you know how I do this ?

Hi Vital,

There is no service to verify the array node is IsDocument or IsString.

But you can verify the same with additional steps in your Flow service as below: (Refer screenshot)

  1. Loop over /documentList
  2. Get indexOf % for %documentList/Value% – this will print as it is if the node is a document , else it will print the node actual value
  3. Do Branch EvaluateLabel True , with two sequence. One sequence if node is string (indexOfPercentage!=‘0’), another sequence if node is again a document (indexOfPercentage==‘0’)

This way you can handle in flow service.

Attached screenshot

You can write a java service that would get the value and then analyze its type.