Hi,
I believe its an inline flow and the condition is the very first check.
I check to see if the value of the “Card” already exist and if it does, the condition should run the “ELSE” otherwise I contiue to the next condition.
I used the toNumber as the value input was set to text and the value in the data store is set to number.
This is the IF condition.
`datastore_cards.data.where(`card`, serverconnectform1.strCardProxy.value.toNumber(), "==").hasItems()`
This is the dmx-on:Submit
dmx-on:submit="run({condition:{if:`datastore_cards.data.where(\\`card\\`, serverconnectform1.strCardProxy.value.toNumber(), "==").hasItems()`,then:{steps:{condition:{if:`serverconnect_availablefunds.data.query_value`,then:{steps:{condition:{if:`((datastore_cards.data.sum(\'cardvalue\') + serverconnectform1.strValue.value.toNumber()) <= serverconnect_availablefunds.data.query_value.mAvailableFunds)`,then:{steps:[{run:{action:`datastore_cards.insert({card: strCardProxy.value, name: strCardName.value, reason: strReason.value, notes: strNotes.value, value: strValue.value, id: datastore_cards.data[0].$id, cardvalue: strValue.value})`}},{run:{action:`serverconnectform1.reset()`}},{run:{action:`strCardProxy.focus()`}}]},else:{steps:{'bootbox.alert':{message:'You don\'t have enough funds on account.',title:'Not Enough Funds',buttons:{ok:{className:'btn-danger'}}}}}}}},else:{steps:[{run:{action:`datastore_cards.insert({card: strCardProxy.value, name: strCardName.value, reason: strReason.value, notes: strNotes.value, value: strValue.value, id: datastore_cards.data[0].$id, cardvalue: strValue.value})`}},{run:{action:`serverconnectform1.reset()`}},{run:{action:`strCardProxy.focus()`}}]}}}},else:{steps:{'bootbox.alert':{message:'The card number is already in your list of cards to be activated. Please check the number again.',title:'Card Already in List ',buttons:{ok:{className:'btn-danger'}}}}}}})"