UIB | Button Clicked - setValue to field

Spaceballs
Kilo Sage

Hi,

I'm wondering if is possible when I clicked the button on the workspace and have the Category field in the form set to string "ABC"? 

 

Here is the configuration

 

Spaceballs_1-1676061658992.png

Spaceballs_2-1676061747245.png

Spaceballs_3-1676061774694.png

 

The link will navigate to the form

Spaceballs_4-1676061908332.png

 

6 REPLIES 6

Michael Fry1
Kilo Patron

You can create a client script with the field/value you want to set. Then you can call that client script in your Event when the button is clicked:

Screenshot 2023-02-10 at 4.02.19 PM.png

@Michael Fry1 , thank you for your response. I followed your instruction but the field did not update the value that I specified.

Spaceballs_1-1676065512598.png

Spaceballs_2-1676065534742.png

 

function handler({
    api,
    event,
    helpers,
    imports
}) {
    api.data.glide_form_1.setValue({
        fieldName: 'category',
        value: 'ABC'
    });
    api.data.glide_form_1.save();
}

Is there any setting I need to set in the glideform?

Spaceballs_0-1676065457918.png

 

You value is in capital letters! You need to change the script and the value to lower case.

unfortunately is not working. 

This is how I setup the button

Spaceballs_0-1676293274156.pngSpaceballs_1-1676293303528.png

Link to destination - External URL 

https://instance.service-now.com/x_964096_my_test_1_control_master.do?sys-id=-1

 

Execute Client Script

Spaceballs_2-1676293395723.png

Category field is a string type and not a choice type