Replace first character in a text field only if... - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Replace first character in a text field only if...

Last post 01-27-2020 11:44 AM by srudenko. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-24-2020 08:43 AM

    Replace first character in a text field only if...

    Hello Lets say I have a text field that gets populated with values based on other controls in the form and the value is something like this: ;aaa@email.com;bbb@email.com;ccc@email.com How do I remove the first character in a string ONLY if it starts with ; If its anything else then leave it as-is? Thanks
  • 01-24-2020 09:33 AM In reply to

    Re: Replace first character in a text field only if...

    On the field that is being set (target field) add a rule. The condition on the rule be if the target field begins with ; and the rule will use a substring formula to reset. See attached sample - save the linked file locally. Right click and select design. Preview and enter text that starts with ;
    Hilary Stoupa

  • 01-27-2020 11:29 AM In reply to

    Re: Replace first character in a text field only if...

    Thank you. That worked but now I have a follow up question. Since I have 5 check boxes to create the email string there are many combinations and when adding / removing checks randomly I am running into output where the email address goes away once checkbox is unchecked but extra semicolons remain. EX: aaa@invesco.com;;ccc@invesco.com;ddd@invesco.com; So I tried adding a rule on that email string field Condition - When field contains ";;" Action - translate(., ";;",";") That doesn't seem to do anything however. I am sure I am missing something or doing it incorrectly.
  • 01-27-2020 11:44 AM In reply to

    Re: Replace first character in a text field only if...

    I think I found an answer from another post on this form. Translate doesn't seem to work to change ;; to ; but this does: concat(substring-before(Emails, ";;"), ";", substring-after(Emails, ";;"))
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.