0

Default Arguments in Approval Steps

by
Published Mar 15, 2024

As one of the return key of this step, return an object `default_args` that contains the default arguments of the form arguments.

Scriptยท approval windmill Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 6 days ago
1
//native
2

3
//this assumes the Form tab has a string field named "foo" and a checkbox named "bar"
4

5
import * as wmill from "windmill-client@^1.158.2"
6

7
export async function main() {
8
    // if no argument is passed, if user is logged in, it will use the user's username
9
    const resumeUrls = await wmill.getResumeUrls("approver1") 
10

11
    // send the resumeUrls to the recipient or see Prompt section above
12

13
    return {
14
        default_args: {
15
            foo: "foo",
16
            bar: true
17
        }
18
    }
19
}
Other submissions
  • Submitted by henri186 Deno
    Created 398 days ago
    1
    //this assumes the Form tab has a string field named "foo" and a checkbox named "bar"
    2
    
    
    3
    import * as wmill from "npm:windmill-client@^1.158.2"
    4
    
    
    5
    export async function main() {
    6
        // if no argument is passed, if user is logged in, it will use the user's username
    7
        const resumeUrls = await wmill.getResumeUrls("approver1") 
    8
    
    
    9
        // send the resumeUrls to the recipient or see Prompt section above
    10
    
    
    11
        return {
    12
            default_args: {
    13
                foo: "foo",
    14
                bar: true
    15
            }
    16
        }
    17
    }