We help IT Professionals succeed at work.
Get Started

Using Rules to Concat a Form Tracking Number

-Polak
-Polak asked
on
156 Views
Last Modified: 2015-03-02
Hi Experts,

I'm attempting to use rules and filters to set the value of @TrackingNumber to create a unique value for my filename when submitting to SharePoint.

FYSA: I have a SharePoint List with OpLocationCode, OpRegion, OpBranch, OpUnit, and OpRegionCode all in a single SP List.

When a user makes a selection on the @OpLocationCode control all subsequent fields populate using rules and filters. For Example, when a change is made to @OpLocationCode the following rule/filter runs on @OpRegionCode @OpRegionCode[OpLocationCode = @OpLocationCode]

I have 4 of these rules/filters set up to cascade the correct values automatically into the controls that are dependent on @OpLocationCode.

At the end of these 4 rules/filters I have a 5th rule that attempts to Set the value of @TrackingNumber to:
concat(substring(now(), 1, 5), OpRegionCode, "-", OpLocationCode, "-", substring(now(), 6, 2), substring(now(), 9, 2), substring(now(), 15, 2), substring(now(), 18, 2))

The end result should make the tracking number look something like this:
2015-SER-HMU-02252956

Instead the tracking number looks like this:
2015--HMU-02252956

Basically, the "SER" which is @OpRegionCode is missing. Now I believe that is because the value for @OpRegionCode is blank at the time the 5th rule runs to set the tracking number. (I've tested by setting a condition that says run if @OpRegionCode is not blank and the rule does not run)

I realize that I could just have the tracking number set on form submit; however, I'd really just like to have it populate a tracking number when a user is done selecting an @OpLocationCode. Can I accomplish this?
Comment
Watch Question
Director of Business Integration
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE