Hi, I'm having a little trouble working with the view expression binding syntax even while using documentation. Below I am trying to select the rows of Tag Name (string) where UDT Header ID (int) is Dropdown value (int) but I only get what is shown in the below screenshot. I know I am probably just misunderstanding some syntax.
view("SELECT 'Tag Name' WHERE 'UDT Header ID'==args[0]",{parent.custom.UDTDetails},{../FlexContainer/FlexContainer/udtTypeDropdown.props.value})
Yup. You are asking for the literal string 'Tag Name' to be delivered for matching rows, and view(), in the absence of an AS clause, munges that to produce a column name. You received no rows because your args[0] doesn't contain the literal string 'UDT Header ID'.
When a source dataset has column names that aren't valid python variable names, you must use the munged version (without any quotes) in your python expressions within the pseudo-SQL.
{ I recommend using compliant column names in your datasets. }
Try this:
view(
"SELECT Tag_Name WHERE UDT_Header_ID==args[0]",
{parent.custom.UDTDetails},
{../FlexContainer/FlexContainer/udtTypeDropdown.props.value}
)