Loop 2 files, each w/ 2 keys

Rewrite:

Compare the values in file1 and file2 and display the value and id lines from file2 if they do not match.

The expected output:

value: line10
id: 22
value: line14
id: 8

Failed Attempt:

#!/usr/bin/bash

for all in "$(cat file1)"
do
    for ids in "$(cat file2 | grep value | awk {'print $2'})"
    do
        if [ "$all" != "$ids" ]
        then
            echo "$ids"
        fi
    done
done

Here is the corrected code:

#!/usr/bin/bash

while read -r line; do
    if ! grep -qF "$line" file2; then
        echo "value: $line"
        awk -v val="$line" '$0 ~ val {print "id: " $2}' file2
    fi
done < file1

This code reads each line from file1 and checks if it exists in file2. If a line in file1 does not match any line in file2, it prints the value and corresponding id lines from file2.