• 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.