Get first value of InfoPath dropdown, not the ID
-
12-01-2021 - |
質問
I'm trying to get first value of InfoPath dropdown. Dropdown is bound to a SharePoint lookup column. This is the XPath to get first value of InfoPath dropdown.
xdXDocument:GetDOM("OfficeApplications")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[1]/d:Title
But this returns the lookup ID, not the value. How to get the lookup value?
解決
It is because the default value of the lookup is ID.
Your scenarios:
List B has a lookup column (named “listA”) to List A’s “Title” column, List C has a lookup column (named “listB”) to List B’s “listA” lookup column.
You want to get the “listA” lookup column value from first item of List B.
Solution:
Need to filter the list A items based on the lookup ID from the lookup column (“listA”) of the first item in List B first item, then you can get the Title value instead of ID.
In this form, has two secondary data sources:
listA --> the data source of List A
listb --> the data source of List B