support both .id and .val in optValue