Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Tip: Nesting field specs for simple property set DB-like capability

456 views
Skip to first unread message

Open eSignForms

unread,
Jul 11, 2012, 1:59:40 PM7/11/12
to openesig...@googlegroups.com
Using a custom action to set a field value, you can look up a property value using another field as the key, giving a simple DB-like lookup capabilities.

For example, let's say you have a field, productId, and it perhaps is set from a drop down list, but it's values are 1, 2, 3, etc. 

We can create a property set, say ProductInfo, with a property values such as:
Id1_Price = $5.00
Id1_Description = This describes the first item.
Id2_Price = $25.50
Id2_Description = This describes the second item.
Id3_Price = $19.99
Id3_Description = This describes the third item.

Now, you want to get the product's price by it's id, you could create a field productPrice and in a custom action set it based on the current productId value using nested field specs: ${property:ProductInfo.Id${productId}_Price}

And you can get it's description using: ${property:ProductInfo.Id${productId}_Description}

This same technique also works if to select a property set (and/or the property name within the set), so if I instead had property sets named Product_1, Product_2, Product_3, etc. and they each had properties name Price and Description, we'd have property sets set something like:

Product_1.Price
Product_1.Description

Product_2.Price
Product_2.Description

Product_3.Price
Product_3.Description

which could be accessed depending on the productId using:

${property:Product_${productId}.Price} and ${property:Product_${productId}.Description}

I hope this is a useful tip for those who need a simple lookup database that is based on some other value.  The trick is that property set names and property names are limited to our standard field naming convention, so it must start with a letter, be composed of letters, numbers and underscores and be no longer than 50 characters each.

Open eSignForms

unread,
Mar 5, 2013, 9:15:29 PM3/5/13
to openesig...@googlegroups.com
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages