Variable disappearing after User Action node

 3 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Lance Kelley
Advanced Member
Posts: 24
Advanced Member
    I load a string variable early on in my PFlow that is used much later in a branch, but after debugging a bit, it's clear that the variable is emptied after a User Action Node.  It just disappears, or more strictly, it is cleaned out and changes from "YES" to "    " yet it isn't referred to in any of the nodes around the area it gets 'cleaned out' in. 

    Anyone else seen this or have a workaround to fix it?

    Thanks!
    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      I've seen this with the non-persistant variables (values from Queries and AGS calls) but if you define a variable and Assign a value to it then it should be okay throughout the life of the flow.
      David Williams
      Lance Kelley
      Advanced Member
      Posts: 24
      Advanced Member

        To all, one thing I discovered as part of my problem is that I didn't have the variable, equal size, and the value being assigned 'tight' on the line.

        In other words, some of the assignments did not persist if they looked like this:

        a = "cow"  (a space on either side of the equal sign)

        ...but DO persist if they look like this:

        a="cow"    (no spaces)

        Life got better after I removed the spaces.  I hope this helps someone out there... it was driving me crazy.

        ...Lance

        Gary Davies
        Veteran Member
        Posts: 248
        Veteran Member

          It should not  matter whether spaces are included or not, what does matter is was the assign done using Javascript (the javascript button on the assign node), this will make the assign non-persistant.   You can ensure it is stored after your User Actions with a simple assign of the variable to itself using the Assign without javascript. after the javascript within the same assign node.