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.

Look for data differences among all fields between two records?

Featured Replies

I have a situation where I have a table with 10 fields and only two records, and I want to compare them and spot any differences. I have written a script that compares the two records by:

 

a) Set ten variables with the contents of the ten fields of record 1.

B) Go to next record.

c) Set ten more variables with the contents of the ten fields of record 2.

d) Compare the twenty variables, a pair at a time (one from record 1, one from record 2) to be alerted when a pair doesn't match.

 

But now I have to do the same thing to a table with 75 fields (and still just two records). I feel as if there may be a better way, as this would take a very long time to set up the way I was doing it. Does not seem efficient at all, and seems like it would easily break. Any input would be appreciated. Thank you.

If you want to spot the difference/s, then you must compare each pair individually. However, you could automate the process by having the script loop over the fields of the table/layout, using the FieldNames() function.

  • Author

Thanks for your comment, Comment, You had a great idea. I've implemented that and works like a charm. Thank you!

#

Set Variable [$fields; Value:FieldNames ( Get ( FileName ) ; "Comparison Layout" )]

Set Variable [$fieldCount; Value:ValueCount ( FieldNames ( Get ( FileName ) ; "Comparison Layout" ) )]

Loop

  Set Variable [$currentField; Value:GetValue ( $fields ; $fieldCount )]

  Go to Records/request/Page [First]

  Set Variable [$value1; Value:GetField ($currentField)]

  Go to Records/request/Page [Next]

  Set Variable [$value2; Value:GetField ($currentField)]

  If [$value1 ≠ $value2]

    Show Custom Dialog ["Inequality"; "FieldName: " & $currentField & " doesn't match. Record 1: " & $value1 & " Record 2: " & $value2]

  End If

  Set Variable [$fieldCount; Value:$fieldCount - 1]

  Exit Loop If [$fieldCount = 0]

End Loop

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.