Filter one record by another record in Flowscript

I want to loop through two records in Flowscript and when one value is not found in one recordset I want to add it to another record and out put it. The two records I want to loop through are the output variables from a grid control;
One is called _dsMap2 and the other is called _dsMap
I have an outer loop that loops through _dsMap and an inner loop that loops through _dsMap2.
The two records have the same name values in the output; a field called “LI_NO”. They different values for tht in each record. I want to find the “LI_NO” that is in one but not in the other…
Then I want to output that to a declared record variable (with one field; “LI_NO”). It must be a record, not a table.
My code is below, it isn’t correct but I think I am on the right track
Can anyone help?

        LET _missingParts=[LI_NO];     

FOR _dsMap_rec IN _dsMap DO

    FOR _dsMap_rec2 IN _dsMap2 DO 

       if _dsMap_rec2.LINE_NO!= _dsMap_rec.LINE_NO then

      
         LET _missingParts = [LI_NO=_dsMap_rec.LINE_NO];

      END

DONE

done

RETURN _missingParts;

Hi,
I am not sure what you want to do if we were to find more then one that do not match?
But if you just want one record you will have the last one it finds in the loop by doing this:

LET _missingParts=[LI_NO:''];   
FOR _dsMap_rec IN _dsMap{
      IF(any(_dsMap2 where LINE_NO =  _dsMap_rec.LINE_NO) = false){
              SET _missingParts= [LI_NO: _dsMap_rec.LINE_NO] ; 
      }
}
RETURN _missingParts;

If you want all, i sagest you use a table, and then the JOIN function to make it ; seperated.
Hope it works out!
Have a nice weekend!

This solution worked, thank you.