Adding Users to a Group

MCorbin
MCorbin Overachievers Alumni

I'm trying to build a workflow that will automatically add users to a Smartsheet Group if their email is our company's domain (to make it easier to share WorkApps and some universal workspaces).

I've got everything working but the darn HTTP call to add to the group

I am using Get Row to pull email addresses from my Users sheet (where I upload the User list from Admin Center).

In the HTTP Call, I'm trying to insert the data reference for the email into the body of the HTTP Call, but it's not working...

Any ideas what I'm doing wrong?

image.png


Tags:

Answers

  • MCorbin
    MCorbin Overachievers Alumni

    This is the error I'm getting:

    "Unable to parse request. The following error occurred: Unexpected character ('\\' (code 92)): was expecting double-quote to start field name\n at [Source: REST input; line: 1, column: 4]"

    我试着removing the first \ but still getting the error.

    I'm guessing that it has to do with the data reference (email from the Get Row in my Users sheet), but I've tried switching that up and it's not working either.

    That column in the sheet is a text column - could that be the problem?

  • Brian_Richardson
    Brian_Richardson Overachievers

    Melanie here's the format I used in a Bridge workflow to push a body. No \ escape on the " marks. You may not need the [] array brackets or the extra object {}, that was a requirement for this particular workflow (Google Address Validation)

    {"address": {"addressLines": ["{{runtime.data.cells.5049890497318788.value||}}"]}}

    I would maybe try the following formatting for yours and see if it works? Also did you already run this through Postman and ensure that the API is just working in general?

    {"email":"{{states.startstate.smartsheet.get_row.row.cells.Email.value||}}"}

    I always put || in my references so that it doesn't error and stop the entire workflow if email happens to be blank on a row.

    One other idea - on a POST you have to put a header in for Content-Type with a value of application/json. Otherwise most APIs won't recognize your body at all.

    The "Unexpected character \\" error is, I think, coming because it sees the \" that you have and thinks it needs to escape the escape, so Bridge adds another \ to the mix, then the API doesn't understand what it's supposed to do with \\" in the body.

    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

  • Brian_Richardson
    Brian_Richardson Overachievers
    edited 05/19/23

    You can also try leveraging the Form Parameters instead of the body, sometimes I find that is easier to use and works. So you'd have a Form Parameter called email with a Value of {{states.startstate.smartsheet.get_row.row.cells.Email.value||}}

    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

  • MCorbin
    MCorbin Overachievers Alumni

    Woo hoo!!!!

    This worked! {"email":"{{states.startstate.smartsheet.get_row.row.cells.Email.value||}}"}

    I need to remember that darn pipe - it's gotten me before.....


    Thank you@Brian_Richardson! !

Hi @Matthew Drake<\/a> <\/p>

There currently isn't a way to overlay an Outlook Calendar on top of a Smartsheet Calendar; you can do the reverse, publish dates from Smartsheet into Outlook.<\/a><\/p>

Please provide your feedback to the Product team through this form, here.<\/a><\/p>

Thanks,<\/p>

Genevieve<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":343,"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations","allowedDiscussionTypes":["discussion","question"]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":91824,"type":"question","name":"Dynamic View - Dropdown Lists","excerpt":"I have certain single and multiple select list columns that do not have the \"restrict to dropdown values only\" checked on the source sheet but in Dynamic View we are unable to add in our own values if they don't exist in the dropdown. This has been extremely frustrating especially when trying to capture new values and…","snippet":"I have certain single and multiple select list columns that do not have the \"restrict to dropdown values only\" checked on the source sheet but in Dynamic View we are unable to add…","categoryID":343,"dateInserted":"2022-06-06T17:24:20+00:00","dateUpdated":"2022-06-14T14:39:36+00:00","dateLastComment":"2023-08-25T19:03:11+00:00","insertUserID":113932,"insertUser":{"userID":113932,"name":"Emmy Anderson","url":"https:\/\/community.smartsheet.com\/profile\/Emmy%20Anderson","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!jplUI_CI3bw!8o9VN1d3-no!6TkM7ozjpN6","dateLastActive":"2023-05-04T14:55:16+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":91566,"lastUserID":156788,"lastUser":{"userID":156788,"name":"Chris Broughton","url":"https:\/\/community.smartsheet.com\/profile\/Chris%20Broughton","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!p0HeqRqVoXw!8_nRN9ijwLw!lUie_n6pld_","dateLastActive":"2023-08-25T18:59:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":567,"score":null,"hot":3347530651,"url":"https:\/\/community.smartsheet.com\/discussion\/91824\/dynamic-view-dropdown-lists","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/91824\/dynamic-view-dropdown-lists","format":"Rich","tagIDs":[319],"lastPost":{"discussionID":91824,"commentID":392652,"name":"Re: Dynamic View - Dropdown Lists","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392652#Comment_392652","dateInserted":"2023-08-25T19:03:11+00:00","insertUserID":156788,"insertUser":{"userID":156788,"name":"Chris Broughton","url":"https:\/\/community.smartsheet.com\/profile\/Chris%20Broughton","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!p0HeqRqVoXw!8_nRN9ijwLw!lUie_n6pld_","dateLastActive":"2023-08-25T18:59:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2022-06-08T12:36:40+00:00","dateAnswered":"2022-06-06T18:38:56+00:00","acceptedAnswers":[{"commentID":332119,"body":"

Hi @Emmy Anderson<\/a> <\/p>

You are not missing anything. This is how DV works with dropdowns unfortunately. My work around in the past is to create an other option in the drop down, user chooses save. Then have logic built for a text field that appears so the user can input the values not present in dropdown. <\/p>

Hope this helps<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":343,"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations","allowedDiscussionTypes":["discussion","question"]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":319,"urlcode":"functionality","name":"functionality"}]},{"discussionID":66594,"type":"question","name":"Is there a way to use OR in a Dynamic View filter condition?","excerpt":"In a View, I can create a custom filter that selects where the Project Lead is \"Mike\" but I want to also say \"OR Debbie.\" Is that possible? It looks like I can only choose AND.","snippet":"In a View, I can create a custom filter that selects where the Project Lead is \"Mike\" but I want to also say \"OR Debbie.\" Is that possible? It looks like I can only choose AND.","categoryID":343,"dateInserted":"2020-03-09T22:27:57+00:00","dateUpdated":"2022-06-14T14:36:49+00:00","dateLastComment":"2023-08-23T08:56:50+00:00","insertUserID":34501,"insertUser":{"userID":34501,"name":"MikeChambers","url":"https:\/\/community.smartsheet.com\/profile\/MikeChambers","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/CT5AV825MQ3E\/nG12D47VYRO8A.jpg","dateLastActive":"2023-03-05T01:19:05+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":91566,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":9,"countViews":438,"score":null,"hot":3276579287,"url":"https:\/\/community.smartsheet.com\/discussion\/66594\/is-there-a-way-to-use-or-in-a-dynamic-view-filter-condition","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/66594\/is-there-a-way-to-use-or-in-a-dynamic-view-filter-condition","format":"rich","lastPost":{"discussionID":66594,"commentID":392055,"name":"Re: Is there a way to use OR in a Dynamic View filter condition?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392055#Comment_392055","dateInserted":"2023-08-23T08:56:50+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/814\/KBHVAAPJ5RYA.jpg","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"OR.jpg"},"attributes":{"question":{"status":"accepted","dateAccepted":"2020-03-12T17:06:46+00:00","dateAnswered":"2020-03-12T13:01:18+00:00","acceptedAnswers":[{"commentID":242817,"body":"

You are more than welcome!<\/p>

Glad to hear that it worked for your present use-case. <\/p>

Remember! <\/strong>Did my post help or answer your question or solve your problem? Please help the Community by <\/em>marking it as the accepted answer\/helpful<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":343,"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations","allowedDiscussionTypes":["discussion","question"]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=343&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-dateLastComment&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":643,"limit":3},"title":"Trending Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts