PF and record counts

 9 Replies
 0 Subscribed to this topic
 164 Subscribed to this forum
Sort:
Author
Messages
Laura J
Basic Member
Posts: 4
Basic Member
    Hello, I have created my first PF to capture assets from the AMASSET table and dispose the asset if a condition is met. I added an email message to include the asset number disposed. I would also like to build into my email message the number of transactions processed. I am using xxxxxx_RECORC_COUNT but it always returns 0 not the actual number processed. Any suggestions would be greatly appreciated on how to return the actual record count of transactions processed.
    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      Are you trying to capture the number of records from the query? Are you capturing this count after the query has processed or within the query loop? I'm pretty sure you have to capture the count after the query loop and not within it.
      David Williams
      David Williams
      Veteran Member
      Posts: 1127
      Veteran Member
        And just to be sure, you are referencing it as xxxxxx_RECORD_COUNT - I figured you had a typo but just wanted to be sure.
        David Williams
        Kyle Jorgensen
        Veteran Member
        Posts: 122
        Veteran Member
          Also, be sure the "xxxxxx" in xxxxxx_RECORD_COUNT is the node's ID, not the node's name.
          Laura J
          Basic Member
          Posts: 4
          Basic Member
            Hi, thank you for the quick responses!  I am trying to capture the count after the initial query.  After my query I am assigning a variable to the asset field. What type of node should be used to capture the record count?
            David Williams
            Veteran Member
            Posts: 1127
            Veteran Member
              If you need to retain the data returned from a query within your flow, you should define a variable in the Start node and then assign the query results, including record count, in an Assign node right away. The results of a query are non-persistant, meaning they can get lost within the flow after, for example, a Branch or a UserAction.

              If you need to reference the Query_RECORD_COUNT within an email, you are better off to assign that to a variable right after the query is run.
              David Williams
              Laura J
              Basic Member
              Posts: 4
              Basic Member
                Thank you, that was helpful. I added the Query_Record_Count to the Assign and I am receiving the record count but it is now only processing the last asset found in the query.

                For example, Query finds 3 assets to modify. The Assign Variables are Asset_ID and Count
                Branch Asset_ID.length>0 perform Transaction then message builder with Asset_ID and Count
                Email message contains the last asset identified in the query and the only asset transaction processed is also for the last asset found and Email message contains Count = 3

                What else could I be missing?
                Bob Canham
                Veteran Member
                Posts: 217
                Veteran Member
                  If your query is returning multiple results and you need to action in each one, then you need to do the transaction node inbetween the query node and its return node. Then the transaction will happen for each queried record. You would also include your message builder to add the asset information. Then when the query loop is complete, you can use the Query_RECORD_COUNT and the message builder in an email to send a summary.
                  Laura J
                  Basic Member
                  Posts: 4
                  Basic Member
                    Thank you all for your suggestions.  With my lack of knowledge and training on PF's I'm just not getting it so I am moving on! Thanks again! 
                    Shane Jones
                    Veteran Member
                    Posts: 460
                    Veteran Member
                      Laura,
                      Send me your flow and i will structure it so you can visualize how it would work. (don't want you to give up)...

                      Shane Jones
                      Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
                      Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
                      ** Teach others to fish...