Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Auto Enter Calculation with a IF statement

Featured Replies

  • Newbies

Hello,

I'm trying to do an auto enter calculation with an IF statement when importing data. I have one field that will either have an IP address or a computer name. If the field is a computer name, i want to strip out some of the text before the actual computer name. The format of the field with a name is (DOMAIN\computer-name), I'm attempting to strip the DOMAIN\ out and just return the computer name. If I do the calculation without the if statement then it works, for the computer name, but removes the IP address.

This is the formula that I have

If ( Position ( Self ; "\" ; 1 ; 1 );
   GetValue(Substitute(TextFormatRemove(Self); "\"; ¶); 2);
   Trim(TextFormatRemove(Self))
)

Basically if the string has a "\" then apply the GetValue… line, otherwise do the Trim Line. The error i'm getting is 

Quote

A number, text constant, field name or “(” is expected here.

Any help would be greatly appreciated.

3 hours ago, maxbehr said:

If I do the calculation without the if statement then it works

Does it really? The expression:

GetValue(Substitute(TextFormatRemove(Self); "\"; ¶); 2)

alone should generate an error, because it contains a text constant that does not end with a quotation mark. That's because the backslash character is an escape character; to include a literal backslash in a text constant, you must escape it itself:

GetValue(Substitute(TextFormatRemove(Self); "\\"; ¶); 2)

and likewise:

Position ( Self ; "\\" ; 1 ; 1 )

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.