Hi there,
I have a custom routing code that is working fine. How do I modify the code to include a second condition to route to another form based on a different people picker field. Below is the code. I have another people picker field called 'HiringManager'. I want to add an extension to this code that basically says, if they are in the 'HiringManager' column route it to a different form ID of a form set. Is this possible in one set of code?
i.e. Check if they belong to the 'HiringManager' picker field --> route to a Form ID (A)
if not check if they belong to the 'People' picker field --> route to a Form ID (B)
Code below:
//check if Item already exists, will return true for Edit and Display Form
if (item) {
//first, get the current user
var user;
// return Promise
return web.currentUser.get()
.then(function(u) {
user = u;
return item.get();
})
.then(function(item) {
//if field People contains current user's ID
if(item.PeopleId && item.PeopleId.indexOf(user.Id) >= 0){
//return ID of a Form Set
return '2a936286-fdac-4788-80fe-d73f3b173fef';
}
});
}