cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RyanMesser
Frequent Visitor

Getting Employee ID number from API from a webhook

Hi,

We use some HR software and I need to get out of the HR software using webhooks a specific number that I can then use in another application to create Holiday appointments in a schedule. 

 

When the request is recieved into flow it just dumps like this 


[{"key":"{\"ActionId\":\"6\",\"Action\":\"Holiday Deleted\",\"EmployeeId\":\"36\",\"HolidayType\":\"A day or more\",\"StartDate\":\"2019-10-21\",\"EndDate\":\"2019-10-21\",\"HolidayRecordedIn\":\"Days\",\"PartOfDay\":\"\",\"StartDatePartOfTheDay\":\"\",\"EndDatePartOfTheDay\":\"\",\"Duration\":\"1.00\",\"Comments\":\"TEST DONT APPROVE\",\"IsToilHoliday\":\"No\"}","value":""}

 

So i wanted to convert this to a string which I'm doing but I have no idea what the best way of getting the employee ID value is in Flow? In this case I just want "36" returned but it could be any number depending on the employee.


Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @RyanMesser 

 

This is what you need to do.

ii1.png

ii2.png

 

The above schema is as follows (Copy and paste the below in your flow step)

{
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
]
}
}

 

 

ii3.png

 

The above schema is as follows:

{
"type": "object",
"properties": {
"ActionId": {
"type": "string"
},
"Action": {
"type": "string"
},
"EmployeeId": {
"type": "string"
},
"StartDate": {
"type": "string"
},
"EndDate": {
"type": "string"
},
"HolidayRecordedIn": {
"type": "string"
},
"Duration": {
"type": "string"
},
"Comments": {
"type": "string"
},
"AuthorisedByFirstName": {
"type": "string"
},
"AuthorisedByLastName": {
"type": "string"
},
"HolidayType": {
"type": "string"
},
"PartOfDay": {
"type": "string"
},
"StartDatePartOfTheDay": {
"type": "string"
},
"EndDatePartOfTheDay": {
"type": "string"
},
"IsToilHoliday": {
"type": "string"
}
}
}

 

ii4.png

 

Here is my test result:

ii5.png

 

If you need any further help please let me know.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

5 REPLIES 5
abm
Super User
Super User

Hi @RyanMesser 

 

Is this the JSON result sets?  Could you please post another result sets as well. The one below is missing some square brackets?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
RyanMesser
Frequent Visitor

Yes, it returns in JSON so when a change is made on the HR App side it triggers flow, I'm then convering that JSON into a string. 


I've put in a condition that looks for "Approved" as this is the action I'm looking for, the JSON for that looks like the below. So I need to get the Employee ID number in this case its "84"

 

[
{
"key": "{\"ActionId\":\"8\",\"Action\":\"Holiday Approved\",\"EmployeeId\":\"84\",\"StartDate\":\"2020-08-17\",\"EndDate\":\"2020-08-28\",\"HolidayRecordedIn\":\"Days\",\"Duration\":\"10\",\"Comments\":\"\",\"AuthorisedByFirstName\":\"Ryan\",\"AuthorisedByLastName\":\"Messer\",\"HolidayType\":\"A day or more\",\"PartOfDay\":\"\",\"StartDatePartOfTheDay\":\"\",\"EndDatePartOfTheDay\":\"\",\"IsToilHoliday\":\"No\"}",
"value": ""
}
]

 

 

Hi @RyanMesser 

 

Thanks for the reply. It's a bit odd that it shows key amd value attribute as null. Lets see what I could do with it. Will let you know soon.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @RyanMesser 

 

This is what you need to do.

ii1.png

ii2.png

 

The above schema is as follows (Copy and paste the below in your flow step)

{
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
]
}
}

 

 

ii3.png

 

The above schema is as follows:

{
"type": "object",
"properties": {
"ActionId": {
"type": "string"
},
"Action": {
"type": "string"
},
"EmployeeId": {
"type": "string"
},
"StartDate": {
"type": "string"
},
"EndDate": {
"type": "string"
},
"HolidayRecordedIn": {
"type": "string"
},
"Duration": {
"type": "string"
},
"Comments": {
"type": "string"
},
"AuthorisedByFirstName": {
"type": "string"
},
"AuthorisedByLastName": {
"type": "string"
},
"HolidayType": {
"type": "string"
},
"PartOfDay": {
"type": "string"
},
"StartDatePartOfTheDay": {
"type": "string"
},
"EndDatePartOfTheDay": {
"type": "string"
},
"IsToilHoliday": {
"type": "string"
}
}
}

 

ii4.png

 

Here is my test result:

ii5.png

 

If you need any further help please let me know.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

RyanMesser
Frequent Visitor

Thanks a lot for that! That works, and I can see what your doing now so I will use this for future reference. 

 

Only difference I have is that the trigger is using the request trigger but effectively the same steps.

 

Thanks again

 

Ryan

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,888)