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

Swaping data in fields

Featured Replies

  • Newbies

How would I do this?

if field c is "Yes"

then transfer value of field a to field b

if field c is "No"

then transfer value of field b to field a

any help is greatly appreciated

A simple way would be:

If(C="Yes")

Set Variable ($D;Value:$D=:

Set Field(B;A)

Set Field(A;$D)

End If

And the reverse for "No"

What would be "the reverse" here?

OK, 'comment', maybe the word "reverse" was not the right choice, but in helping a beginning I will gladly post the alternative answer choice so no thinking is necessary.

If(C="No")

Set Variable ($D;Value:$D=A)

Set Field(A;:

Set Field(B;$D)

End If

Doesn't this "reverse" process accomplish the same result? What is the reverse of "swap"?

The script steps I posted, I believe, answer the original question, although it seems like I am missing something.

Please explain.

The original question is not clear to me. If I read it literally, it says:

If [ C = "Yes" ]

Set Field [ B ; A ]

Else

Set Field [ A ; B ]

End If

But the title of the thread says "swap". A swap is what both your scripts do - and they both do the same thing, except in different order. So the value of C is simply ignored.

You're right. Only one swap is needed. If C="No" then it should do nothing.

Although in your example, doesn't the result of C="Yes" leave the values for A and B both equal to A, and the original value of B is lost. Thus it is not a "swap" but maybe just a replacement of value.

Yes, my script does literally what the original post says should be done, therefore one of the two values is lost in the process.

I suspect the real answer here lies in a calculation field =

Case ( C = "Yes ; A : B )

but as I said, I do not really understand the question.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.