asked 10 hours ago

I'm rebuilding a process that was the wrong way around, workflow starting batches of instances off of what was basically an Excel spreadsheet as an ODBC data source. I'm also rebuilding the clients old forms processes in modern designer, because Lookup and Field rules are way easier. 

It's for company card transactions, and I wanted to present a list of transactions in a collection, but some transactions can have a set of distributions. I'm a decent SQL programmer, so I created a set of relational database tables and was clever enough to put an index column in the one to many relationship between the 'Card Transactions' table and the 'Purchase Distributions' table. 

Then I put them together in a view and populated my Form collection from the view. The view orders the results by transaction ID and the distribution index. 

By putting the 'Index Number' of the distribution in a hidden field in my collection I was able to tie a field rule to it. If the index of the current collection item is 1 show all the fields. If the index of the current collection item is 2 or more a second hidden field with a formula that says 'TRUE' if the index number isn't one. 

Then I have a field rule that hides all the 'non-table' items in the collection when the 'Hide Headers' field is 'TRUE'. 

The result is this. I wish I could say I planned it this way, but it was a happy accident. The only very trivial thing I'd like to add to this is a combo of JS and CSS to remove the field labels on those additional rows. 

 

0 0