EnumList from another table

Hi all,

I have two tables, “Appointment details” and “Hair Services”.

Hair Services has the following column:
[Service]
[Estimated Time]

I want to create an EnumList in the “Appointment details” table which adds multiple services from the “Hair Services” table. Also, I want to calculate the total time for each service and store it in a virtual column in the “Appointment details” table.
The appointment table should have the following.
Service list: (Enum list form Hair Service table)
Total time: (VC sums the estimated time for each service added)

Is there an app formula that I can use?
I see that part of this question has already been answered previously using SELECT and IN, but for some reason, I get an error (Parameter 2 in IN is wrong).

Any help is really appreciated. Thanks in advance.

Thanks,
Ankit

in Service List Table make data type enumlist…

and in the data validity of this column header put the below expression

Hair Services[Service]

where Hair Services refers to the table and Service refers to the column in the table Hair Services

It should work without any issue

Thank you for your response. The issue is, I need to reference the Service list column to Hair Services[Service] column because I also want to calculate the estimated time of each service that is added, based on the column Hair Services[Estimated time].

in that case u have to first create a child table to add service list…in the child table u can add any no. of services the customer wants to use and in the parent table you use an expression to calculate the total time reqd for this customer.

1 Like

Thank you for your response. I have created the “Service list” as a ref to “Service” in the “Hair Services” table and have modified the virtual column in the “Hair Services” table with the following app formula.

SELECT(Appointment details[Uniqueid], IN([_THISROW].[Service],{“Service list”}))

I assumed that this will generate an enum list type reference for the Service list column but it just creates a one to one reference. How can I add multiple Services to one appointment?

Hope my question is clear.

Thanks in advance

For that u have to create a child table using isapartof in the table …

First create a new table with columns like unique id, order id(this will be the key of main table), Service REQD, time taken,

Order id should be made ref and isapartof should be turned on

Then in the main table add a new column naming it total time reqd and put formula

Sum(select(childtablename[time taken],[order id]=[_thisrow].[keyofmaintablecolumheader]))

This will do the job

2 Likes

That worked. Thanks a lot.

Ankit

1 Like