How to Show Yes/No Confirmation on input screen in Mobile App Builder

monica_detani
Mega Sage

Hi team,

I’m working in Mobile App Builder and have a form where users can scan two serial numbers via an input screen. When the form is submitted, I display two different messages:

  1. "Not found" – if no matching asset record is found for the serial number.
  2. "Updated" – if the asset record is found and updated successfully.

Now, I want to enhance this behavior. When an asset is not found, I’d like to present a Yes/No confirmation dialog. If the user clicks "Yes," it should create a new asset record with the serial number that was provided in the input screen.

How can I implement this confirmation logic with the Yes/No option in Mobile App Builder?

PFA SS for reference:

 

3 REPLIES 3

PrashantLearnIT
Tera Sage

Hi @monica_detani 

 

 

  • Navigate to the Form Submission event on your screen.
  • Use a Decision flow to check if the asset exists:
    • If the asset is found, show the "Updated" message.
    • If not found, proceed to show the Yes/No dialog.

 

 

Hi Prashant,

Sorry can you please elaborate ?

FYI i am using mobile app builder function: 

monica190_0-1730268131607.png

In the action item i have defined execution script as:

(function WriteBackAction(parm_input, parm_variable,actionResult) {
    var serialNumbers = parm_input['barcode_section_out.serial_number'];
    if(parm_input["barcode_section_out.serial_number"].length >0)
    {
    for (var i = 0;i<parm_input["barcode_section_out.serial_number"].length; i++) {
        var serial = parm_input["barcode_section_out.serial_number"][i];
        var gr = new GlideRecord('alm_asset');
        gr.addQuery('serial_number', serial);
        gr.query();
        if (gr.next()) {
            gr.install_status = "6";
            gr.substatus = "available";
            gr.update();
            gs.addInfoMessage("Asset with serial number: "+gr.serial_number+" Updated successfully");
        } else
            gs.addErrorMessage("No asset found with this serial number: "+serial+ "do you waana create new shell asset for this serial?");
    }
    } 
})(parm_input, parm_variable,actionResult);

monica190_1-1730268231624.png

From where exactly should I call decision flow?

 

Hi @monica_detani  did you find a solution to this?