You could potentially do this natively in Freshservice though I wouldn’t recommend it as, in my opinion, Freshservice is not that great at email management.
Your first hurdle here would be making sure that the Email from HR is always in the same format and, ideally, the Subject regularly contains the same word sequence every time. If the email always comes from the same email address this will be far easier. If these hurdles already seem to be solved then you might be able to build a reliable process via something like Power Automate.
What you would do is connect the mailbox that is receiving the emails from the HR platform to Power Automate.
The start of the Power Automate flow would be something like ‘Email is received’ with the conditions of ‘Subject contains these words’
Here comes the next tricky bit; you will then need to map the appropriate lines of the email to each of their counterpart fields in your Onboarding Form. This is likely going to take a lot of playing around with ‘indexOf()’, ‘substr()’ and ‘split()’ expressions in order to get the text you need from your emails.
You’ll want to store each subsequent expression as a variable and then reference those in the JSON body of a HTTP request node at the end of your Power Automate flow.
That HTTP request node should be doing a POST to https://orgname.freshservice.com/api/v2/onboarding_requests/
Whatever account is going to be submitting these Onboarding requests is going to need access to the Onboarding module in Freshservice.
Dan, have you been able to successfully achieve this? I’m attempting to do the same but cannot get it to work. I keep getting errors like the ones below. I have a bunch of expressions pulling the data from the email and have tried hardcoding the values just to get it to run
{
"description": "Validation failed",
"errors": o
{
"field": "cf_employee_id",
"message": "It should be of type String",
"code": "missing_field"
},
{
"field": "cf_full_name",
"message": "It should be of type String",
"code": "missing_field"
},
The API call is there to create an onboarding request so I would think it’s doable.
Teresa
Dan, have you been able to successfully achieve this? I’m attempting to do the same but cannot get it to work. I keep getting errors like the ones below. I have a bunch of expressions pulling the data from the email and have tried hardcoding the values just to get it to run
{
"description": "Validation failed",
"errors": o
{
"field": "cf_employee_id",
"message": "It should be of type String",
"code": "missing_field"
},
{
"field": "cf_full_name",
"message": "It should be of type String",
"code": "missing_field"
},
The API call is there to create an onboarding request so I would think it’s doable.
Teresa
Hi what’s your payload you send to the API ? Can you show us ?
This is what I’m sending. The placeholders all appear to return data correctly because it shows in the Execution logs. I’ve also tried hardcoding the data and get the same response.
POST https://hdomain].freshservice.com/api/v2/onboarding_requests
{
"cf_employee_id": "{{E20.result}}",
"cf_full_name": "{{E10.result}}",
"cf_role": "{{E12.result}}",
"cf_job_code": "{{E11.result}}",
"cf_job_title": "{{E19.result}}"
}
This is the request body that shows in the execution log. Everything looks like a string to me.
{
"cf_employee_id": "0030346",
"cf_full_name": "James Holmes",
"cf_role": "473",
"cf_job_code": "473",
"cf_job_title": "Credit App Associate III"
}
the payload should look like this
You are missing the “fields” key.
{
"fields": {
"cf_employee_name": "Andrea",
"cf_job_title": "HR",
"cf_date_of_joining": "2020-08-20",
"cf_all_users": "andrea@freshservice.com",
"cf_department": "HR",
"cf_assets": 1,
"cf_location": 5,
"cf_hierarchy": "L3",
"cf_verified": true
}
}
Thank you! That did it. Learning the API/JSON stuff as I go. Really appreciate your help! Now I just need to figure out the rest of the fields
Thank you! That did it. Learning the API/JSON stuff as I go. Really appreciate your help! Now I just need to figure out the rest of the fields
I use Postman to test things