Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
lmc.engineering
in reply to: RNDinov8r

Hi @RNDinov8r 

 

Looks to me that you just need to change your logic here. We can just assume if it's not found the iProperty then we go straight to creating it. No need to add it as a blank and test for it's value in the same routine; that's likely your issue why it doesn't work; You need to update the document between creating the iProperty and testing for it's value.

 

The below should work better for you.

 

Dim ValueList As New List(Of String)({"Round", "Square", "Other" }) ' Add more options here if needed
Dim iPropVal As String

Try
	'See if the iProperty exists currently
	iPropVal = iProperties.Value("Custom", "Form Factor")
Catch ex As Exception
	'It doesn't exists, so create it
	iPropVal = InputListBox("Prompt", ValueList, ValueList.Item(0), Title := "iLogic", ListName := "Form List")
	If iPropVal Is Nothing Then Return ' User closed form before selecting option
	iProperties.Value("Custom", "Form Factor") = iPropVal
End Try