Mobile App Academy: Supporting reference qualifiers on input form screens
good morning everyone and welcome to mobile app Academy this is our live building Series where we show you how to build and configure mobile apps on the mobile platform my name is David hodd and I'm an outbound product manager here at servicenow and I'll be your host for today's session I want to give a warm welcome to everyone joining us here live today and if you're joining us for the first time welcome to the session uh we're here to provide guidance best practices and answer any questions that do come up along the way and we do host these academies every two weeks at 10 A.M Pacific uh in which our recordings will be posted onto YouTube on the servicenow and now Community Channel um just want to point out a few resources that we do have available if you are new to mobile we recommend that you check out some of our self annulment resources such as our mobile guidebooks white papers and we also have a plethora of other resources such as Labs mobile trainings on now learning as well as our playlists to all the other previous app academies where you can find sessions like mobile agent quick start guide getting started with now Mobile in 30 over 30 other Academies but just to quickly review our schedule for today um this will be a very quick 20-minute session we'll start it off with a quick overview our goals for today what we will Implement and how to get started and then we'll jump into the exercise today we're going to be building an input form screen with uh using reference qualifier inputs um inputs and Fields like assigned to and so forth right and then we'll open up to some q a uh along the way feel free to post any questions you have in the chat also if you are looking for more Hands-On training uh in case uh uh you're a bit newer to mobile I do recommend that you check out our now learning uh course called Mobile use Baseline functions um as well as some of our earlier app academys which you can find on our community site if you're not quite up to speed on today's topic uh you can start by watching our getting started with input form screens on YouTube and uh those are great resources to get started on learning how to use input form screens why they're um why we moved over from action items uh UI parameters and item parameters over to input form screens and then how to build those data functions okay but with that all set let's jump into our overview okay so input form screens this is what we use to build native actions for users with various input types right you have input types such as string number Boolean date time choice and of course you have reference qualifiers as well today we will be building an input form screen using reference inputs these are used to filter and start data that gets returned to that end user and so if you're filling out Fields like they assigned to it's only going to show you a subset of all available values based on that reference field and for the assigned to it's referencing the assignment group so if you were to select an assignment group like NorCal technicians it will only show you the assignees who are in that NorCal technician region right and for today's session we're actually going to be using a field service submission use case as an example um uh as technicians are auditing their stock rooms they'll scan assets to confirm their inventory but for assets that don't show up they'll need to create new asset records and so we're going to build a create asset function that allows my agents to fill out the model the model category and asset tags of those new assets okay and uh just a quick note this is a recorded um we do have this short 10 minute implementation video that will take us through this uh so let me go and pull this up and we'll get started I am Ian Kinnear from the outbound enablement team and in this session I'd like to walk you through advanced reference qualifiers on mobile this is something that's been available since the Rome release but it's a very common question so we'll review it again here the good news is that as long as your fields are set up properly on platform with the working Advanced reference qualifier mobile will simply leverage that here's an example a hardware asset new record form with model category and model fields on it here we can see that if we were to just select the model directly we've got a huge list to select from however if we first select the model category such as a printer that model lists is going to be automatically filtered by that model category selection in the other field how that's set up and take a look at so this is a dictionary entry for the model field you can see an advanced reference qualifier here it's going to leverage the model and category filters script include and in there a function called asset model refqual and it's passing in the current record context so what we're going to do is we're going to set up our mobile app asset lookup function which is available in field service to also allow the user to create a new asset and we're going to create these model and model category fields so let's first access our mobile app builder and under functions we'll click new we'll call it create asset SD lab function and in this case we'll make the context Global since we won't be in the context of a specific record when we enter into this function create a new action item which we can call create asset SD lab action item we'll give it a new type so we can create a new asset the table is going to be Hardware we'll skip over field values for a second because we still have to create our input form screen so we'll click new here make a new input form screen and here we're going to scroll down to the input form page display and to better illustrate this example we'll put all of our inputs on one page so we'll click on custom page and section setup we'll skip over over inputs and variables and go down to pages and create a new page name doesn't matter so let's call it this give it an order of 10. we'll click save just so it's available back on our input form screen we'll go ahead and start creating our inputs next So based on what we just saw on the platform side we'll want to model category and model field at least so let's start with model category thank you this is going to be an input type reference obviously we'll make it mandatory give it an order of 10. and we'll scroll down and put it on that page that we just created and since it's a reference field we need those two input attributes for reference Fields require at a minimum The Source table and Source field name so we'll click new here we'll find our source table it's going to be the hardware field click back onto our input and make it new input attribute called Source field name for this we'll first select the table so that we can select the fields model category now we'll click back over to our input form screen and add the model so we'll find our inputs click View call this model and give it a label it will also be a reference field given an order of 20 and we can make it mandatory as well scroll down and select the page that we had created previously and same as the model category we'll add these two input attributes first one is going to be the source table which again is going to be Hardware click back to the input create a second attribute this one is going to be the source field name and for this we'll identify the table where we can find that field which is again the hardware table and scroll down and select the model now lastly just to fill out this input form we'll go ahead and create an asset tag field because that's how we're searching by to find a particular asset so we'll scroll down to our inputs on the input form screen and click new and we'll create a field called asset tag go to label this one can stay a string give it an order of 30. and same as the other two Fields we'll add it to that same page this one doesn't need any input attributes so we're pretty much ready to go with our function we can click save but we just need to add it to our asset lookup screen so that after we search for an asset we can tap into that function so we'll click over to our main mobile app builder screen and select screens I'm going to look for asset lookup a list screen just here now this will take a few seconds to load so I'll just explain what we're going to do after it loads all we're going to need to do is on the list green top level configuration find the top menu functions and add a new function instance you can give a label like create Hardware asset and point it to the specific function that we just created so let's quickly do that make sure we're on our asset lookup list screen scroll down to our top menu function instances click new give it a name and a label like create Hardware asset we can give it an order there's only one function instance in this top menu but it's good practice to give it an order in case we add more then we'll scroll down to the bottom and choose our function so we'll search for it select it here and click apply and now we can save and we should be ready to test it out but before we do there's one other piece we need to do in order to complete our function so let's tap back to our main menu in mobile app builder click on functions find our function and open it up and then we'll click on our action item and here we'll just scroll down and identify the field values that are going to be updated when the user submits the form and we can do that now because we created our three inputs so first one is model category was selected from our data pill selector here next is the model and last is the asset tag just be careful here because it's a string field it'll automatically put a space in here so in case that happens just click into the field and make sure there's no space and click save so now let's look over at our mobile device refresh the screen and we'll scroll over and select our asset lookup now this is going to open up the camera for you to scan but we can also tap into the function and search for an asset tag that we know won't be there so in this case I search for A2 and we can also see that we have our top menu function available and as expected we didn't find anything so we'll go ahead and create a hardware asset and we can see the three fields we configured same as on platform if I was to tap directly into the model I'm going to see the full list here but if I first select the mode category and select the printer then select the model you can see it's leveraged that advanced reference qualifier and it's filtered that model list so we can select one we'll put in that asset tag that we searched for tap submit and you can see we got our new asset created so that's all you need to do in order to leverage your Advanced reference qualifiers in the mobile app so that wraps up our Academy for today if you found this session helpful please let us know in our post session survey and uh thank you all for joining us today and we hope to see you again in two weeks at our next Academy
https://www.youtube.com/watch?v=IXdiRmcNj-o