Hello friends, the problem i have come upon is that i’m trying to load information from different tables into a single workflow doc template, i’d like to pull a list of unique ids from [TABLE A], and be able to use that list of ids using the context of [TABLE B] for the columns inside said start expression.
Is there a way to do this without having those tables directly referencing each other?
To give a better idea of my problem, imagine a basic shopping app, where a customer picks some products and amounts, a simple workflow doc template would display a list of the items and amounts the customer bought for that given order.
In my case i need to display all the items that the customer is able to buy, even those that he hasn’t purchased, that list of all products is in [TABLE A], and the individual item purchase records are in [TABLE B].
Solved! Go to Solution.
Looks like there’s two requests here:
For this, it sounds like what you need to do is extract from your orders the list of products selected - then you want to use that list inside a <<START: in a workflow so that the product details are displayed in the workflow instead of the order details.
For this, check out List dereferences:
I’m assuming you’ve got an Order parent level, and then order details where people select the individual products they want (and quantity, etc.)…
[Related OrderDetails][ProductID]
This will product a list of all the values in the [ProductID] column for all the related records.
With this on the Order level, you can then use this column’s values inside your <<START: expression
<<START: SELECT(Products[ProductID],
IN([ProductID], [_ThisRow].[Products_From_OrderDetails]))>>
For this one, take a look at List dereferences and list math (addition/subtration)
You can easily create a list of the products selected (list deref from the OrderDetails), then take the master list of products and subtract from that the items the person has already selected.
Alternatively, if you added the Master List to the list of products selected by the user;
On an entirely different note:
It’s entirely possible to store a list of references inside an EnumList - with the base type text if you want.
You can also easily store a list as a string (inside a LongText/Text column) by wrapping the list formula in CONCATENATE().
Just fyi.
Hi Matt ! thank you for your detailed answer, i’ll study everything you mentioned and i’ll report again after i give it a go.
Hello again @MultiTech_Visions , after struggling a whole day i realized i was over complicating the problem.
In my case i need to display all the items that the customer is able to buy, even those that he hasn’t purchased, that list of all products is in [TABLE A], and the individual item purchase records are in [TABLE B].
It’s just comes down to displaying the whole list of items of [TABLE A] and using the reference with [TABLE B] to sum each item’s “related sales” in order to obtain the accumulated total of sales per item.
To do that, i need to be able to filter the related sales based on a column named [OrderNumber] that is within the table that triggers the workflow, and is also recorded in each item sale, i’m trying something like:
<<SUM(
SELECT(
[Related Items sold][Qty],
[OrderNumber]<[_THISROW-1].[OrderNumber]
)
)
>>
Any suggestions? i’m not very familiar with the use of [_THISROW] in template variables, and haven’t managed to grasp the concept after reading the documentation about it.
oooh sheeeeeet, it works at last ! thank you @Steve and @MultiTech_Visions, i learned a lot from your replies, at one point yesterday i was complicating the matter so much i was about to
User | Count |
---|---|
43 | |
29 | |
23 | |
21 | |
13 |