Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Help with scripted mobile action function, please.

gjz
Mega Sage

I am very new to Mobile App Builder and am creating my first mobile app and I need help understanding how to create a function that is scripted and uses variables.

 

On the mobile app, I have a record details screen using Table A where the function is placed on the footer.  When the function is tapped, it opens an input screen that accepts multiple barcode scans of asset tags.  When the user is done scanning, the function needs to update a Table B in a script. The script will need the sys_id of the record from Table A and the scanned assets from the input form screen.

 

I'm having trouble figuring out how to capture the sys_id of the record from Table A to use in a WriteBackFunction in the action.  

 

Can anyone help me, please

 

 

1 REPLY 1

Sanjay191
Kilo Patron

Hi @gjz 

Please follow the below steps

1 create function instance 

Sanjay191_0-1790588594252.png


2.Now, you need to create a function and link it to that function instance.

This function will accept multiple asset tag barcodes and perform the asset related process for each scanned asset.

Sanjay191_1-1790588662503.png
3. You need to create a group input field that allows users to scan multiple asset tag barcodes.


Sanjay191_2-1790588810943.png


4.You can retrieve those asset tags logically, as shown below. Now, you have all the scanned asset tags available for further processing.

Sanjay191_3-1790588971039.png

 

 

  1. Now, you can process the logic as per your requirement. For example, if you want to apply the current configuration to Table A, you can retrieve the sys_id of the record in Table A using " input.sys_id ", as this is the Data parameter.

Please refer to the screenshot below. In this example, I am using the Work Order Task table, where these configurations will be applied. You can modify it according to your requirement.

 

 

Sanjay191_5-1790589265383.png

 

Sanjay191_7-1790589712069.png




If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You