cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
jeff
Nintex Newbie

Form Values Wrapped in <Value> Tag?

A weird one today that I'm guessing is just something I'm doing wrong.

I have a workflow with a form variable "Send to" (Choice field with options "POC" and "QC Inspector"):

And than a Run If action...

At some point the workflow stopped working. After some troubleshooting I started logging the output of the "Send to" variable to a history log and am seeing it mysteriously wrapped in a "<Value>" tag...

If I change my Run If to "contains" instead of "equal" (e.g. variable contains "POC" v. variable equals "POC") my workflow runs again.

Does anyone know why or how this form value would begin returning wrapped in a "<Value>" tag?

I'm using an unmodified OOTB InfoPath form:

Thanks!

0 Kudos
Reply
2 Replies
Automation Master
Automation Master

Re: Form Values Wrapped in <Value> Tag?

Because you're using an Infopath Form, I assume that it is the nature of that beast which is returning values to you in some type of XML format rather than a semicolon delimited string (which is how Nintex Forms returns multi-select values). 

I would recommend running your same test, but instead of only selecting one value, select both. 

Determine: 

  • Did I get text with two (2) opening <Value> and closing </Value> tags like: 
    <Value>POC</Value>
    <Value>QC Inspector</Value>‍‍‍‍

    • If this is the case, then you should be able to wrap that XML-Like text inside of a parent node, and push all of the values into a collection using the Query XML Action.


      (this would hold the values from your forms, but I am not using infopath so I'm just going to hardcode them in there)

      By Wrapping that variable inside of some generic parent xml-like node,  you can easily xpath your way to success: 


      Now all of your values should live inside of that collection (in this example, named: 'var_someCollectionVar'). 


       
  • Did I get text with one (1) opening <Value> and closing </Value> tag like: 

    <Value>POC QC Inspector</Value>‍‍‍‍

    • If only (1) Opening <Value> and closing </Value> tag were present, are the values inside delimited in some consistent fashion?

      <Value>POC,QC Inspector</Value>‍‍‍
      or
      <Value>POC; QC Inspector</Value>‍‍‍

      • Then we use the Query XML Action just like above, only instead of saving it to a Collection, we'll save it BACK to the var_InfoPathFormVals variable. 



        Doing this should leave us with a string like "POC; QC Inspector" or "POC, QC Inspector". Depending on the delimiter, you'll then set up a Regular Expression Action using the Split Command. 

        (That Pattern is \; being that it's a bit difficult to see)

Either way, you should now be able to parse the information in your workflow however you'd like. 

I hope that this helps. 


Reply
jeff
Nintex Newbie

Re: Form Values Wrapped in <Value> Tag?

Thanks so much for your thoughtful and interesting solution. Selecting both values does indeed return "<Value>POC</Value><Value>QC Inspector</Value>" so I'm sure your approach would work, and when I get time I'll implement it because I like the precision of knowing those values exactly.

For the time being I went with a much lazier solution, simply testing the variable to see if it contains "POC" or "QC Inspector" (which works because this is currently the only use for the variable):

I guess my bigger concern is why did this suddenly change to be like this, and if it's some kind of global change (e.g. a SharePoint update happened) do I have this problem in other workflows but don't know it yet?

I ended up with the InfoPath form only because I selected that option for "Form type" when creating the workflow. Somehow it was created by Nintex (I presume) when the workflow was published. I haven't tried to touch or modify it at all....it's all out-of-the-box.

Thanks again for the solution!

0 Kudos
Reply