• 0

InfoPath Substring and Translate Help


Question

Hello

 

I am trying to set up what I am sure is a simple rule but I have not used the Substring and Translate functions before so am unsure of the correct formatting on what I need.

 

The initial field has the now() function so it displays the date/time. What I'd like the rule to do is change the fields value to a 6 digit string using the month and time as such:

 

2016-04-22T11:53:21 would become 041153

 

I know this can be done using the Substring and Translate functions but have not used them myself before. Any help would be greatly appreciated :)

1 answer to this question

Recommended Posts

  • 0
  On 22/04/2016 at 17:02, Brandon H said:

Hello

 

I am trying to set up what I am sure is a simple rule but I have not used the Substring and Translate functions before so am unsure of the correct formatting on what I need.

 

The initial field has the now() function so it displays the date/time. What I'd like the rule to do is change the fields value to a 6 digit string using the month and time as such:

 

2016-04-22T11:53:21 would become 041153

 

I know this can be done using the Substring and Translate functions but have not used them myself before. Any help would be greatly appreciated :)

Expand  

I don't know anything about InfoPath

 

https://en.wikipedia.org/wiki/Microsoft_InfoPath

 

"JScript, Visual Basic, C#, and other languages can be used to extend InfoPath's capabilities" and "XPath Expressions and Functions can be used to calculate values by applying functions to the value of fields in the form"

 

From that, I will assume the question is about XPath

 

( I used to wonder why Microsoft discontinued InfoPath, but after looking at XPath, I no longer wonder)

 

https://blogs.msdn.microsoft.com/infopath/2007/02/19/calculating-new-default-date-and-time-values/

 

From that blog post it looks like you would use substring 3 times to get your text and then join with concat

 

concat(substring(now(),???,???),substring(now(),???,???),substring(now(),???,???) with ??? being the right values for substring to get the 2 chars

 

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • A guy messaged me yesterday wanting to talk on the phone, it turns out his friend messaged on "marktplaats" a day earlier asking what my lowest price was (€1650). After talking for a bit about it (he says he has no experience with computers and is relying on his friend) and then confirming with his friend, he messaged me he wanted to pick it up today. They both came today to check it out, and pick it up. SOLD. I prefer it this way rather than having to cannibalize it to sell for parts.
    • Was taking the side glass panel off because I want to install the AORUS X870E Master GPU holder, and while I had the glass side panel in my hands the front one decided to take a kamikaze dive. Now I hope they sell the glass fronts separately, or I am screwed. I'll probably be finding bits of glass for weeks now  😅
    • Yeh, I think you'll find there wasn't much legit savings from what he did. Any chump can fire a bunch of people indiscriminately from positions and services that don't impact that person. At the end of the day, it just means that services that are essential in any functional democracy, won't be able to operate because there are no people to deliver those services. Sure, it "saves" money on paper, but like most short sighted bean counters, there are very real, and expensive impacts later on down the track. Did you know that by buying 2x toothbrush's and a tube of toothpaste every year, and seeing the dentist every 6 months would cost you about $400 a year? So by the time you're in your 30's that would be $12000 of cost! Now imagine if you didn't spend any of that $12000 on preventative oral health care! Wow, so much more money! But you also needed to have several root canals at $1500 per tooth. Plus the time off work for being unable to function with the pain. So lets face it, that initial cost is worth it!
    • You know, there needs to be some sort of regulatio... oh wait..
  • Recent Achievements

    • One Month Later
      greege earned a badge
      One Month Later
    • Week One Done
      greege earned a badge
      Week One Done
    • Week One Done
      LagFighterZ earned a badge
      Week One Done
    • First Post
      ThatGuyOnline earned a badge
      First Post
    • One Month Later
      5i3zi1 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      547
    2. 2
      ATLien_0
      230
    3. 3
      +FloatingFatMan
      166
    4. 4
      Michael Scrip
      119
    5. 5
      +Edouard
      91
  • Tell a friend

    Love Neowin? Tell a friend!