How to create master-detail sections?

 From this tutorial you will learn how to create a master-detail section and how to launch one app from another.

You will create two apps - one with a work shift form and one for choosing to whom we want to send the form. The second one will also be launching the form app.

 

1.Create the sending app 

 

1.a

Add two widgets- a spreadsheet and a table. Bind the table with "Sysuser" list. It's a list that contains information about all of your qalcwise site users. All of the columns bind with list fields: email, name, isactive.

1.b

Hide B and C columns by putting =false in visibility field. 

Screen_Shot_09-20-18_at_12.07_PM.PNG

1.c

Put header names into first spreadsheet row. Bind the spreadsheet section with the table by filing the 'filter' field with a lookup formula.

Screen_Shot_09-20-18_at_01.15_PM.PNG

 

Now bind cells with table columns. You can do it by manually writing the column names in cells:

Screen_Shot_09-20-18_at_12.13_PM.PNG

1.d

Set C2 cell type to 'Checkbox'. 

What you have just created is a master-detail section - a special type of section with a spreadsheet and a table in which form the smaller table section (master) we choose an element for which information we view in the spreadsheet (detail). ( read more )

 

2. Work shift form

2.a

Create a new app. Add a new table section. Change its headers to: start hour, end hour and shift duration.

2.b

 Set type of two first column to "DateTime". In third column set the type as Number and fill it with a formula like below. It will calculate the duration of the shift.

Screen_Shot_09-20-18_at_01.23_PM.PNG

 

 3.Parameter

3.a

An employee's email is the parameter that will be passed from the sending app to this one. We need to specify that in our app. You need to add a new input parameter type text.

Screen_Shot_09-20-18_at_01.27_PM.PNG

 

3.b

Now save changes and go back to your first app. Add a new 'button' widget. Click on it and add a new 'run app with one param' action. In action options put second app name, parameter name and the field in which email is located - parameter value that we will be passing. 

Screen_Shot_09-20-18_at_01.37_PM.PNGScreen_Shot_09-20-18_at_01.36_PM.PNG

 

4.Workflow

Save the first app and go back to second. Add a new workflow actions widget.

4.a

In workflow tab create 3 new states:

-sent

-accepted

-rejected

 

4.b

Create 3 new actions:

-ask the employee

-accept

-reject

The scheme of our workflow:

Screen_Shot_09-20-18_at_01.44_PM.PNG

 

 5.Passing the parameter

5.a

Add a new spreadsheet section with one column. In first cell put a question to your employee about the shift e.g. "Can you take this shift?".

5.b

In second cell chosen employee's email will be shown. To make it possible put an input formula in this cell with the passed parameter name in brackets.

Screen_Shot_09-20-18_at_01.50_PM.PNG

5.c

 Go to workflow tab and add the 'set editors' actionstep to action 'ask the employee'.  In 'Editors' field put address of the cell that we created in the previous step (the input cell). Now only the employee that was sent the form will be able to make a decision to accept the shift or not.

Screen_Shot_09-20-18_at_01.55_PM.PNG

 

6.Preview

 See how your app works. You can do it either by clicking the 'preview' button or by simply running the app. If you want to run it remember to add yourself as the creator of both apps beforehand.

A correctly working app should run the app with the shift form after clicking the button.

Screen_Shot_09-20-18_at_03.03_PM.PNG

Screen_Shot_09-20-18_at_03.04_PM.PNG

Screen_Shot_09-20-18_at_03.01_PM.PNG

 

 But what if we wanted to ask all of the employees at the same time?

There is a simple way to do so.

7.App distribution

7.a

Open the sending app. In column A of the table add 'Email' alias. Add workflow actions widget. Next, go to workflow tab and create one action and one state: 'send to all' and 'sent'.

Screen_Shot_09-20-18_at_03.57_PM.PNGScreen_Shot_09-20-18_at_03.57_PM_001.PNG

7.b

 Add a new actionstep 'distribute app from table' to 'send to all' action. Go to actionstep options and there fill in the app field, table section and alias for the column in which the email is. 

Screen_Shot_09-20-18_at_04.03_PM.PNG

 

 8.Time parameter 

Now, we would want to send shift hours to all employees, but we cannot do that using the form. Let's do it using the sending app.

8.a

Add two new columns to the right side of the table. We need them to pass start time and end time parameters. Add 'start_time' and 'end_time' aliases to them and set them as editable. Change the headers to same names as aliases. Set them as 'DateTime' type.

 8.b

Save the distributing app and go to form app. Add two new input parameters named the same as previous aliases: 'start_time' and 'end_time'. Set their type as 'DateTime'.

 Screen_Shot_09-20-18_at_04.15_PM.PNG

8.c

In A and B columns put input formula and in its brackets write time parameters names which will be passed to themScreen_Shot_09-20-18_at_04.18_PM.PNG

Thanks to these changes you now have two possible options while asking about the shift : sending to all employees at once or to a single employee.

 Sending to all employees looks like this:

Screen_Shot_09-20-18_at_04.32_PM.PNG

Screen_Shot_09-20-18_at_04.33_PM.PNG

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk