Replace first character in a text field only if... - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » Replace first character in a text field only if... 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: Oldest to newest Newest to oldest Previous Next 01-24-2020 08:43 AM srudenko Joined on 08-06-2012 Posts 23 Replace first character in a text field only if... Reply Contact 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 Hilary Stoupa Joined on 06-20-2008 Posts 13,294 Re: Replace first character in a text field only if... Form1.xsn Mark as Not AnswerMark as Answer... Reply Contact 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 srudenko Joined on 08-06-2012 Posts 23 Re: Replace first character in a text field only if... Mark as Not AnswerMark as Answer... Reply Contact 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 srudenko Joined on 08-06-2012 Posts 23 Re: Replace first character in a text field only if... Mark as Not AnswerMark as Answer... Reply Contact 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.
Use our Google Custom Search for best site search results.