0
votes

I am still learning, and looking for help on how to display a label based on one data-sources field value, being within another data-sources field value list.

I have one calculated table, displaying rows of documents within a folder, and wish to use a field representing the document number in that data-source, so that if it's ANYWHERE within another tables field it displays my label.

I've been trying to use projection as I think this is how to achieve it.

I can get it working based on both the current @datasouce.item.fieldnames but need it to base the calculation on all possible numbers in that tables field (Image below should make it easier to understand).

I expect that it has something to do with projections, but can't find anything within the learning templates or anywhere else to resolve the issue.

https://i.imgur.com/LIl53ob.png

1
Does your table B display all records from that model or is there a query size limit? How is your table B generated, does it reload the data in B each time you select a different item in table A? Have you considered making the label a field in your calculated datasource and then displaying 'Reserved' based on how you generate your data inside your calculated model? - Markus Malessa

1 Answers

0
votes

I think the following should work for you. For the 'Reserved' label have the following binding for the text property:

(@datasources.project_quotes.items..quotenumber).indexOf(@widget.datasource.item.Qnumber) !== -1 ? 'Reserved' : ''

I would suggest alternatively just to include a field in your calculated datasource and making the determination in your server script.