Default Form Set if NOT belonging to any group

Hi there,

I have a form set designed to be accessible by a Sharepoint Group and that is working well. However, I would like a certain form set to be used when we share an item with a manager. This manager will be given edit access to the item. Is there a way, either through the routing functionality or through the Form Set rules to default a form set to people who dont belong to any Sharepoint group but have been given access to the item.

Or is my best best to give them access to the item by adding them to a group and making that group tied to a form set.

I hope Ive explained myself ok.

Thank you for any help.

Dear @mhannaway,
It would be easier with a group. An alternative would be to use custom routing, and to go through each group and check that the user doesn't belong to any of them. Doable, but much more work.

Hi @Nikita_Kurguzov.

I am attempting custom routing based on a multi person SP Field. Is the below code correct? It still is not working for me. I have a automatic routing configured for one form set. I am trying to setup a custom route to a specific form set based on the current user and them being in a multi-person field.

//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';
}
});
}

Hello @mhannaway,

In Person or Group field that allows multiple values, user IDs are stored as an array. You need to compare the current user ID with each user ID within the array. Try out this code:

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) {
            item.PeopleId.forEach(function(u){
                //then compare User ID to ID of the user in the field
                if (user.Id === u) {
                   return '2a936286-fdac-4788-80fe-d73f3b173fef';
                }
            });
        });
}

Thank you @mnikitina for assisting with this. I have entered the code and it seems to be working however, It only works to owners and members of the site the list belongs to.

If I share a SP list item with someone (item level), the entire Plumsail form doesnt show up. The default SP editing form is visible to them. How do I get the Plumsail Form to show for those I've shared items with? I've granted them edit access.

@mhannaway,

What routing settings did you set for these users? Do you check user ID against Person or Group field value?

Hi @mnikitina , I initially had the routing you configured above based on a multi-person picker field. I would share the item with the employee who will be a person inside the 'People' multi-person column.

However the entire form is not showing, let alone the routed form. Does the person I am sharing item level permissions with have to be a member of the site. It is a Teams site by the way.

@mhannaway,

Do you mean MS Teams? User must have at list view permission to the Site Pages library and the source list of target site to open the form.

Do users see any error or just the blank form? Please share the screenshot of the error on the form or from the browser console.