Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6050 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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

Posted

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.

Posted

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.

Posted

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.

This topic is 6050 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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