Skip to main content
Nintex Community Menu Bar
Question

Compare 2 field values?

  • July 9, 2024
  • 2 replies
  • 8 views

Forum|alt.badge.img+8

What would the JS be for a snippet used to conditionally render a field by comparing 2 other fields to see if they are equal?  In other words, I want to highlight a row in a table if 2 field editor fields are not equal…

This topic has been closed for replies.

2 replies

Forum|alt.badge.img+9

I’m trying to answer 2 of your questions at once… But basically you can run an Inline snippet on page load with something like this (which also compares fields…):

(function(skuid){ var $ = skuid.$;<br>$(function(){<br> &nbsp; &nbsp;//this runs on page load&nbsp;<br> &nbsp; &nbsp;var firstModel = skuid.$M('FirstModel');<br> &nbsp; &nbsp;var firstRow = firstBG.getFirstRow();<br> &nbsp; &nbsp;var secondModel = skuid.$M('SecondModel');<br> &nbsp; &nbsp;var fieldOne = firstRow.field_One__c;<br>var fieldTwo = secondRow.field_Two__c;<br> &nbsp; &nbsp;if(fieldOne !== fieldTwo){<br>//do stuff here<br> &nbsp; &nbsp; &nbsp; &nbsp;secondModel.updateRow(secondRow,'Your_Field__c',yourNewValue);<br> &nbsp; &nbsp;}<br>});<br>})(skuid);

Forum|alt.badge.img+8
  • Author
  • July 9, 2024

nice… thanks Moshe!