Web service only pulling the room number and not the building
I'm trying to create a web service that grabs 2 different custom location/room attributes and sends a notification. The notification is only showing the room number though and not the building. I have tried setting the parameter data type as string and double. How can I get the call to pull in both parts of the attribute?
Asked by Danee Gunka Schwartz
on Fri 11/15/24 9:27 AM
Last edited Mon 11/18/24 2:40 PM
Sign In to leave feedback or contribute an answer
Answer (1)
This answer has been marked as the accepted answer
Mark Sayers
Mon 11/18/24 9:05 AM
Hi Danee,
I think I would have to see more about the web service method in question to better troubleshoot it. Can you provide screen shots showing how you've configured each section of the web service method in TDAdmin? Or else submit it as a support ticket so you can share those shots there?
Sincerely,
Mark Sayers
Sr Support Consultant, CS
No feedback
I think this *could* be an expected behavior given it is a custom Location and Room type attribute, though I would have to test what happens when you GET a ticket that has a value for this type of field. Can you confirm on the ticket in question that it does have a value for both pieces of the Location and Room parts of this attribute field?
- Mark Sayers
Mon 11/18/24 4:01 PM
When I run a Get call on this ticket I receive:
"Name":"Current Location","Order":0,"Description":"","SectionID":0,"SectionName":null,"FieldType":"locationroom","DataType":"String","Choices":[],"IsRequired":false,"IsUpdatable":true,"Value":"302847","ValueText":"Bowen Thompson Student Union - 208","ChoicesText":"","AssociatedItemIDs":[0]},
{"ID":133751,"Name":"New Printer Location","Order":0,"Description":"","SectionID":0,"SectionName":null,"FieldType":"locationroom","DataType":"String","Choices":[],"IsRequired":false,"IsUpdatable":true,"Value":"302845","ValueText":"Bowen Thompson Student Union - 201","ChoicesText":"","AssociatedItemIDs":[0]}, - Danee Gunka Schwartz Tue 11/19/24 8:42 AM
"Name":"Current Location","Order":0,"Description":"","SectionID":0,"SectionName":null,"FieldType":"locationroom","DataType":"String","Choices":[],"IsRequired":false,"IsUpdatable":true,"Value":"302847","ValueText":"Bowen Thompson Student Union - 208","ChoicesText":"","AssociatedItemIDs":[0]},
{"ID":133751,"Name":"New Printer Location","Order":0,"Description":"","SectionID":0,"SectionName":null,"FieldType":"locationroom","DataType":"String","Choices":[],"IsRequired":false,"IsUpdatable":true,"Value":"302845","ValueText":"Bowen Thompson Student Union - 201","ChoicesText":"","AssociatedItemIDs":[0]}, - Danee Gunka Schwartz Tue 11/19/24 8:42 AM
I am asking our product team about the expected behavior on this for you. I'll let you know what they respond with.
- Mark Sayers
Thu 11/21/24 4:11 PM
The expected value of a Location attribute is a location ID. The expected value of a Room attribute in this scenario is a room ID. If you have a room called "Lobby" in 5 different buildings they'll have different IDs and you'll need to adjust based on that ID
- Mark Sayers
Mon 11/25/24 9:07 AM
I'm trying to understand this. The attribute is only 1 entry. The GET call brings back 'location - room' but when I try to put that into a post call it is only bringing in the end part of the attribute.
- Danee Gunka Schwartz
Wed 11/27/24 9:21 AM
Your Parameter, unless you've changed something from what you shared in your original screen shot, shows you pulled the value from this attribute from the ticket's saved value for that field. Even if you were sourcing the value from the results of a GET call, you can only point that parameter at one property, which in this case would be the property representing the ID of the *room* portion of that field, not the value of the Location or a combination of the two.
- Mark Sayers
Mon 12/2/24 9:31 AM
You would almost want to track the two as distinct separate fields so you can dynamically pull the values for each into your notifications, if that is what is needed.
- Mark Sayers
Mon 12/2/24 9:32 AM
We can only use the TDX location attribute once on a form correct? If we had to track the building and room separately we wouldn't be able to use the location DB list that is stored in TDX correct?
- Danee Gunka Schwartz
Mon 12/2/24 10:16 AM
That is correct, as far as you can only use the standard TDX Location field once on a form. Since this is the confirmed behavior, per our Product team, you'd almost have to use both a custom Location type field and a custom Location + Room type field (which would make you select the Location again, yes) to get at both of these values for your web service method in some sort of "clean" way.
- Mark Sayers
Mon 12/2/24 1:24 PM
We are trying to pull 2 separate locations, new and old. But the web service method won't pull in the custom location + room fields.
- Danee Gunka Schwartz
Mon 12/2/24 2:43 PM
What I was showing with the get is that the web method actually gets both attributes but the post method only gets the room number.
- Danee Gunka Schwartz
Mon 12/2/24 2:44 PM
If you were going to source the value from the GET call, I think it would be doable if you have a parameter, sourcing from workflow, where you reference the response body and custom attribute value for that field, then reference the .ValueText property of each Location and Room attribute respectively.
- Mark Sayers
Mon 12/2/24 2:50 PM