Skip to main content
Question

Assigning User to Group if Not in Group


Forum|alt.badge.img+1

Hello,

I would like to set up a pipeline to call API_GetUsersInGroup when a record is created and check to see if the user in a particular user field is in the group and if not, add them using API_AddUserToGroup.

I am struggling to find a way for it to see that the user is in the group and stop the pipeline if they are not. Instead, it always shows they are NOT in the group and tries to add them, erroring out when they are already in the group.

I'm fairly new to all of this, so apologies if it is a silly question - but how can I have it search through the results of API_GetUsersInGroup for my user and correctly identify if they are already in the group? 

I appreciate any assistance!

 

3 replies

Forum|alt.badge.img+19
  • Qrew Captain
  • May 12, 2025

What expression are you using to evaluate the group after the API call?

When ever I have User fields in a Pipeline I have to evaluate them with a .TV.   and not .EX.

 

 


Forum|alt.badge.img+1

This is in essence my problem:

Because it returns all of the users in the group, I need a way to iterate through the list of users and determine if my user is in the list. Because it is XML and not JSON, I don't have a built-in way to do that and I don't know how to do it. I've tried searching but coming up blank or with things not quite what I am looking for and without enough understanding to know how to make it work.

I was originally trying to do this with roles and faced the same issues - if they were not in the group, it would work, but if they were in the group, it would fail because the previous condition didn't catch it. I've tried just looking for key words in the body of the response, which of course doesn't work. I've also tried an advanced filter and even some regex expressions, but I am truly just throwing things at the wall hoping something will work because this is ALL very new to me.

So I can't even get to the part of evaluating, because I don't know how to make it loop through all of the users until it finds a match (or doesn't).

(I tried to put on the "New User" and "Please Be Patient with Me" tags lol - I am not a developer but have become quite handy with Quickbase -- this just goes beyond what I've done and I'm not sure how to learn it -  I appreciate any guidance and assistance!)

 


Top Step
Forum|alt.badge.img+9
  • Registered
  • October 27, 2026

You can skip the membership check entirely. The JSON API's Add members call takes a list of user IDs and answers with a success list and a failure list, and users who are already in the group just land in the failure list instead of erroring out the pipeline.

Add a formula text field on the record with the user's ID:

UserToId([Assigned User])

Then use a Make Request step to POST to https://api.quickbase.com/v1/groups/yourgroupid/members with headers QB-Realm-Hostname set to your realm and Authorization set to QB-USER-TOKEN plus your token, and this body:

["{{a.user_id}}"]

The token needs to belong to someone who can manage that group. One call either adds the user or quietly tells you they were already there.

https://developer.quickbase.com/operation/addMembersToGroup