Jump to content

How to store some rows selected from one table in a document property(as rows)?


giuseppe valenti

Recommended Posts

A document property can be a simple number or string, an array of strings or a binary object. I have seen tables stored into document properties as binary objects, but only via a data function. Once one has a table in a document property, then it can be parsed by another data function. There could be a simpler way to achieve what you wish to do without storing a set of rows in a document property, if you can share what the context is.

Link to comment
Share on other sites

Hello,what i need to do is set a db on demand from 2 different pages,the field is the same columns "lots" but from 2 different tables and pages,sometimes i need to set from pag1 and other times from pag2. This to link an on demand db with many rows to show maps that i can call from pag1 or pag2.

See attachment for a better description.

pag1pag1.thumb.jpg.5b14119a5a37f8bfdc9176f6746ac40d.jpgpag2

pag2.thumb.jpg.55c0e3df6b0656e7e1af1fce27ca48a2.jpgThanks!

Link to comment
Share on other sites

Hello Giuseppe,

Suppose you have two tables A and B and you could somehow populate a third table called AB. If you could do that, you can easily setup your on-demand data table based on the contents of AB

A data function can do this for you by taking two parameters (colA and colB) based on marking from table A and B and create a new table (or replace the existing one) with the union from both

# create sample arraysa = arr1b = arr2 # determine the length of the shorter arraymin_len = min(len(a), len(b)) # combine the elements in the two arrays row-wisecombined_array = []for i in range(min_len): combined_array.append(a) combined_array.append(b) # append any remaining elements from the longer arrayif len(a) > len(b): combined_array.extend(a[min_len:])elif len(b) > len(a): combined_array.extend(b[min_len:]) 

the input parameters for arr1 and arr2 are Columns limited by marking and the output is a new data table

Here is the POC in action

twotables.thumb.gif.e28db4e7c59d62ecf3668f7fa3c094e8.gif 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...