I am trying to modify the new-entry form of a modern list in SharePoint Online by hiding or showing a field based on the value selected in a preceding field on the same form. Microsoft offers straightforward guidance on how to do this using a JSON snippet.
While the article doesn't list a lookup column as an unsupported field type to use for this purpose, it doesn't provide guidance on how to use one in this way, either. From my testing, you can't simply grab the value of a lookup field in the described way:
=if([$LookupField]=='Hourly', 'true', 'false')
If I use a choice field instead of a lookup field, this works fine. But since I've got a lookup field, I did some more digging, and in some other contexts it looks like the value may be captured in a lookupValue property, so I tried it this way:
=if([$LookupField.lookupValue]=='Hourly', 'true', 'false')
But it doesn't work. Elsewhere someone said that by doing some debugging, it looks like the function is expecting this construction:
=if([$LookupField]=='1;#Hourly', 'true', 'false')
No errors, but still no luck. Does anyone know if it is possible to use the value from a lookup field in this way? And how would I do this?