All data from first table is not showing proper data in sql - sql

I am trying to add two tables, in which first table contains all the video details, and in second table details of video seen by the user with user_id and video_id. I just want to add both the tables and it will show all the list of videos from first table but if the video is seen by the user, status will show 1 else 1.
Here is my query,
SELECT
videos.id, videos.lang_id, videos.medical_type_id, videos.name,
videos.description, videos.thumbnail, videos.video, videos.video_type,
videos.delete_status,
CASE
WHEN video_quews.user_id = $user_id
THEN $user_id
ELSE 'ok'
END AS user_id,
video_quews.video_id, video_quews.created_at,
CASE
WHEN video_quews.video_id = videos.id
THEN 1
ELSE 0
END AS status
FROM
videos
LEFT JOIN
video_quews ON videos.id = video_quews.video_id
ORDER BY
video_quews.video_id DESC
Currently, videos are repeating.
Please help me out
here is my response,
{
"message": "All related videos",
"status": "success",
"code": 200,
"videos": [
{
"id": "30",
"lang_id": "2",
"medical_type_id": "15",
"name": "Fracture",
"thumbnail": "thumbnail_images/1579869167.png",
"video": "videos/fracture.m4v",
"video_type": "2",
"delete_status": "1",
"user_id": "6",
"video_id": "30",
"created_at": "2021-03-04 23:29:50",
"status": "1"
},
{
"id": "16",
"lang_id": "2",
"medical_type_id": "14",
"name": "Electrocution",
"thumbnail": "thumbnail_images/1579698529.png",
"video": "videos/ELECTROCUTION.m4v",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "16",
"created_at": "2021-03-05 08:19:29",
"status": "1"
},
{
"id": "15",
"lang_id": "2",
"medical_type_id": "13",
"name": "Adult CPR & AED(Cardiac Arrest)",
"thumbnail": "thumbnail_images/1579698505.png",
"video": "videos/CPR1.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "15",
"created_at": "2021-03-05 08:18:38",
"status": "1"
},
{
"id": "14",
"lang_id": "2",
"medical_type_id": "12",
"name": "Choking",
"thumbnail": "thumbnail_images/1579698405.png",
"video": "videos/Choking.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "14",
"created_at": "2021-03-05 08:17:47",
"status": "1"
},
{
"id": "13",
"lang_id": "2",
"medical_type_id": "11",
"name": "Chest pain",
"thumbnail": "thumbnail_images/1579698381.png",
"video": "videos/CHESTPAIN.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "13",
"created_at": "2021-03-05 08:17:20",
"status": "1"
},
{
"id": "12",
"lang_id": "2",
"medical_type_id": "10",
"name": "Burns",
"thumbnail": "thumbnail_images/1579698360.png",
"video": "videos/Burns.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "12",
"created_at": "2021-03-05 08:16:39",
"status": "1"
},
{
"id": "11",
"lang_id": "2",
"medical_type_id": "9",
"name": "Breathing Difficulties",
"thumbnail": "thumbnail_images/1579698344.png",
"video": "videos/BreathingDifficulties.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "11",
"created_at": "2021-03-05 08:16:19",
"status": "1"
},
{
"id": "8",
"lang_id": "2",
"medical_type_id": "6",
"name": "Asthma",
"thumbnail": "thumbnail_images/1579698286.png",
"video": "videos/ASTHMA.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": "8",
"created_at": "2021-03-05 08:15:59",
"status": "1"
},
{
"id": "24",
"lang_id": "2",
"medical_type_id": "22",
"name": "Fits/Seizures",
"thumbnail": "thumbnail_images/1579698775.png",
"video": "videos/SEIZURES.m4v",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "26",
"lang_id": "2",
"medical_type_id": "24",
"name": "Sprain, strain",
"thumbnail": "thumbnail_images/1579698853.png",
"video": "videos/SPRAIN&STRAIN.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "28",
"lang_id": "2",
"medical_type_id": "26",
"name": "Disposing Glove",
"thumbnail": "thumbnail_images/1579698903.png",
"video": "videos/disposingglove.mp4",
"video_type": "1",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "31",
"lang_id": "2",
"medical_type_id": "8",
"name": "Bleeding",
"thumbnail": "thumbnail_images/1581498917.png",
"video": "videos/bleeding.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "18",
"lang_id": "2",
"medical_type_id": "16",
"name": "Gunshot Wound",
"thumbnail": "thumbnail_images/1579698550.png",
"video": "videos/Gunshot.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "20",
"lang_id": "2",
"medical_type_id": "18",
"name": "Hypoglycemia",
"thumbnail": "thumbnail_images/1579698684.png",
"video": "videos/Hypoglycemia.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "22",
"lang_id": "2",
"medical_type_id": "20",
"name": "Nose Bleeding",
"thumbnail": "thumbnail_images/1579698728.png",
"video": "videos/nosebleeding.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "25",
"lang_id": "2",
"medical_type_id": "23",
"name": "Snake Bite",
"thumbnail": "thumbnail_images/1579698801.png",
"video": "videos/SnakeBite.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "27",
"lang_id": "2",
"medical_type_id": "25",
"name": "Stroke",
"thumbnail": "thumbnail_images/1579698879.png",
"video": "videos/STROKE.m4v",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "29",
"lang_id": "2",
"medical_type_id": "27",
"name": "Dog Bite",
"thumbnail": "thumbnail_images/1579698934.png",
"video": "videos/Dogbite.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "32",
"lang_id": "2",
"medical_type_id": "7",
"name": "Allergy",
"thumbnail": "thumbnail_images/1581580973.png",
"video": "videos/Allergy.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "19",
"lang_id": "2",
"medical_type_id": "17",
"name": "Hyperthermia(Heat Exhaustion)",
"thumbnail": "thumbnail_images/1579698575.png",
"video": "videos/Hyperthermia.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "21",
"lang_id": "2",
"medical_type_id": "19",
"name": "Introduction",
"thumbnail": "thumbnail_images/1579698707.png",
"video": "videos/intro.mp4",
"video_type": "1",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
},
{
"id": "23",
"lang_id": "2",
"medical_type_id": "21",
"name": "Recovery Position",
"thumbnail": "thumbnail_images/1579698747.png",
"video": "videos/RecoveryPosition.mp4",
"video_type": "2",
"delete_status": "1",
"user_id": "ok",
"video_id": null,
"created_at": null,
"status": "0"
}
],
}
Below is my database,
enter image description here

I just want to add both the tables and it will show all the list of videos from first table but if the video is seen by the user, status will show 1 else 1.
I think you want a flag indicating if a user has seen a video. For this, I suggest EXISTS:
select v.*,
(case when exists (select 1
from video_quews vq
where v.id = vq.video_id and vq.user_id = $user_id
)
then 1 else 0
end) as has_user_flag
from videos v

Related

JPA - Create document tree with specific elements from database

I have a web app where you select documents and display them. The document tree is generated from a sql table with a one to many relationship on itself.
What it looks like on the frontend
This tree is generated from an sql table with the following columns :
(page_id, position, title, version, parent_id)
The sql table in question
I can already query this table and retrieve a tree like the following :
{
"position": 0,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"parentId": "2",
"id": "5",
"name": "Page 1"
},
{
"position": 1,
"version": 51,
"parentId": "2",
"id": "6",
"name": "Page 2"
},
{
"position": 2,
"version": 51,
"parentId": "2",
"id": "7",
"name": "Page 3"
}
],
"parentId": "1",
"id": "2",
"name": "Category 1"
},
{
"position": 1,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"parentId": "3",
"id": "8",
"name": "Page 4"
},
{
"position": 1,
"version": 51,
"parentId": "3",
"id": "9",
"name": "Page 5"
},
{
"position": 2,
"version": 51,
"parentId": "3",
"id": "10",
"name": "Page 6"
},
{
"position": 3,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"parentId": "4",
"id": "11",
"name": "Page 7"
},
{
"position": 1,
"version": 51,
"parentId": "4",
"id": "12",
"name": "Page 8"
},
{
"position": 2,
"version": 51,
"parentId": "4",
"id": "13",
"name": "Page 9"
}
],
"parentId": "3",
"id": "4",
"name": "Category 3"
}
],
"parentId": "1",
"id": "3",
"name": "Category 2"
}
],
"parentId": "0",
"id": "1",
"name": "Doc Root"
}
This is the entity class :
#Entity
#Table
#AllArgsConstructor
#NoArgsConstructor
#Getter
#Setter
#JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Node {
#Id
#JsonProperty("id")
private Long pageId;
public String getPageId() {
return pageId.toString();
}
#ManyToOne(cascade = CascadeType.ALL)
#JsonBackReference
#JoinColumn(name = "parent_id")
private Node parent;
public String getParentId() {
return parent.getPageId();
}
private Long position;
private Long version;
#JsonProperty("name")
private String title;
#OneToMany(mappedBy = "parent")
#OrderBy(value = "position asc")
#JsonManagedReference
private List<Node> children;
}
What I am trying to do is to retrieve only parts of this tree depending on the selected nodes. For reference, with the above selections, I'd like to receive a tree with the following content :
{
"position": 0,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"parentId": "2",
"id": "5",
"name": "Page 1"
},
{
"position": 1,
"version": 51,
"parentId": "2",
"id": "6",
"name": "Page 2"
},
{
"position": 2,
"version": 51,
"parentId": "2",
"id": "7",
"name": "Page 3"
}
],
"parentId": "1",
"id": "2",
"name": "Category 1"
},
{
"position": 1,
"version": 51,
"children": [
{
"position": 3,
"version": 51,
"children": [
{
"position": 0,
"version": 51,
"parentId": "4",
"id": "11",
"name": "Page 7"
},
{
"position": 1,
"version": 51,
"parentId": "4",
"id": "12",
"name": "Page 8"
},
{
"position": 2,
"version": 51,
"parentId": "4",
"id": "13",
"name": "Page 9"
}
],
"parentId": "3",
"id": "4",
"name": "Category 3"
}
],
"parentId": "1",
"id": "3",
"name": "Category 2"
}
],
"parentId": "0",
"id": "1",
"name": "Doc Root"
}

What does count at the end of response mean in Postman?

I am starting out with Postman. I made a simple GET request and got a response. At the end of the response, is "count=14". I am trying to understand what count means here?
I thought the number of records in the response is 14, but its only 10. So what does count=14 mean? Thankyou for your response!
This is the response I got:
{
"records": [
{
"id": "074df210-e1fb-4298-9407-d97881dc1af2",
"fullName": "Abcd",
"email": "janedoe#gmail.com",
"phone": "112-112-112"
},
{
"id": "4f0835d7-7c02-43da-86c7-77a03b4",
"fullName": "John Doe",
"email": "johndoe#gmail.com",
"phone": "1234-234"
},
{
"id": "a9e8cfb6-f62a-4a8e-84a5-df30",
"fullName": "Kitty Doe",
"email": "kittydoe#gmail.com",
"phone": "123-493-892"
},
{
"id": "319bdb34-e1c1-4e86-192",
"fullName": "Lovely Doe",
"email": "lovelydoe#gmail.com",
"phone": "089-829-3898"
},
{
"id": "1dfe5bba-e14b-4e9d-b90c",
"fullName": "Memory Doe",
"email": "memorydoe#gmail.com",
"phone": "273-872-8398"
},
{
"id": "61f466d5-ec00-76ccb88fff5e",
"fullName": "asdas",
"email": "asdas#gmail.com",
"phone": "123-123-9231"
},
{
"id": "f77b8e1d-70f2-4d44-b243-e61eac2a41a0",
"fullName": "asdasda",
"email": "asdasda#gmail.com",
"phone": "123-123-1291"
},
{
"id": "7d071c9e-fce6-4732-bed3-c18412a962c1",
"fullName": "Monday",
"email": "monday#gmail.com",
"phone": "123-129-1231"
},
{
"id": "5a1d1e9d-7396-41e3-aa96-864b",
"fullName": "Tuesday",
"email": "tuesday#gmail.com",
"phone": "123-241-2534"
},
{
"id": "f5da56d1-9fc2861e6da3",
"fullName": "Wednesday",
"email": "wednesday#gmail.com",
"phone": "129-121-1212"
}
],
"count": 14
}

Vega-lite difference between Firefox and Chrome

I have a vega-lite chart that shows up as expected in Chrome (72.0.3626.96), but not in Firefox (70.0.1). I have checked the spec in the Vega Editor. Does anyone know why this might be?
Here are the rendered charts:
Firefox:
Chrome:
Here is the spec:
Any help you might be able to give would be much appreciated.
Apologies, but I do not know how to collapse this code.
{
"$schema": "https://vega.github.io/schema/vega-lite/v3.2.1.json",
"background": "white",
"config": {"mark": {"tooltip": null}, "view": {"height": 300, "width": 400}},
"datasets": {
"data-511198e25d4dbee99248144390684caa": [
{
"counts": 338,
"filter_method": "greater than",
"grade": "9",
"index": 3,
"perc": 0.2669826224328594,
"school_code": "Board",
"threshold": "8",
"year": 20172018,
"year_lab": "2017/18",
"year_lab_q": "2017"
},
{
"counts": 414,
"filter_method": "greater than",
"grade": "9",
"index": 4,
"perc": 0.30689399555226093,
"school_code": "Board",
"threshold": "8",
"year": 20182019,
"year_lab": "2018/19",
"year_lab_q": "2018"
}
],
"data-72a083843a98847e44077116c495e448": [
{
"counts": 49,
"filter_method": "greater than",
"grade": "9",
"index": 0,
"perc": 0.3356164383561644,
"school_code": "KING",
"threshold": "8",
"year": 20142015,
"year_lab": "2014/15",
"year_lab_q": "2014"
},
{
"counts": 62,
"filter_method": "greater than",
"grade": "9",
"index": 5,
"perc": 0.3668639053254438,
"school_code": "MLTS",
"threshold": "8",
"year": 20162017,
"year_lab": "2016/17",
"year_lab_q": "2016"
},
{
"counts": 53,
"filter_method": "greater than",
"grade": "9",
"index": 6,
"perc": 0.29608938547486036,
"school_code": "KING",
"threshold": "8",
"year": 20172018,
"year_lab": "2017/18",
"year_lab_q": "2017"
},
{
"counts": 44,
"filter_method": "greater than",
"grade": "9",
"index": 7,
"perc": 0.25882352941176473,
"school_code": "MLTS",
"threshold": "8",
"year": 20172018,
"year_lab": "2017/18",
"year_lab_q": "2017"
},
{
"counts": 53,
"filter_method": "greater than",
"grade": "9",
"index": 8,
"perc": 0.3212121212121212,
"school_code": "KING",
"threshold": "8",
"year": 20182019,
"year_lab": "2018/19",
"year_lab_q": "2018"
},
{
"counts": 61,
"filter_method": "greater than",
"grade": "9",
"index": 9,
"perc": 0.25206611570247933,
"school_code": "MLTS",
"threshold": "8",
"year": 20182019,
"year_lab": "2018/19",
"year_lab_q": "2018"
}
]
},
"height": 400,
"layer": [
{
"data": {"name": "data-72a083843a98847e44077116c495e448"},
"encoding": {
"color": {
"field": "school_code",
"legend": {"labelFontSize": 15, "titleFontSize": 20},
"title": null,
"type": "nominal"
},
"tooltip": [
{
"field": "perc",
"format": ".2%",
"title": "percentage",
"type": "quantitative"
},
{
"field": "counts",
"title": "number",
"type": "quantitative"
},
{"field": "year_lab", "title": "school year", "type": "nominal"},
{"field": "school_code", "title": "level", "type": "nominal"},
{"field": "grade", "type": "nominal"},
{"field": "filter_method", "type": "nominal"},
{"field": "threshold", "type": "nominal"}
],
"x": {
"axis": {"format": "%Y", "tickCount": 5},
"field": "year_lab_q",
"scale": {"domain": ["2013.9", "2018.5"]},
"title": "School Year (beginning)",
"type": "temporal"
},
"y": {
"axis": {"format": ".0%"},
"field": "perc",
"title": "Percentage",
"type": "quantitative"
}
},
"mark": {"point": true, "type": "line"},
"selection": {
"selector001": {
"bind": "scales",
"encodings": ["x", "y"],
"type": "interval"
}
}
},
{
"data": {"name": "data-511198e25d4dbee99248144390684caa"},
"encoding": {
"color": {
"field": "school_code",
"legend": {"labelFontSize": 15, "titleFontSize": 20},
"scale": {"domain": ["Board"], "range": ["black"]},
"title": null,
"type": "nominal"
},
"tooltip": [
{
"field": "perc",
"format": ".2%",
"title": "percentage",
"type": "quantitative"
},
{
"field": "counts",
"title": "number",
"type": "quantitative"
},
{"field": "year_lab", "title": "school year", "type": "nominal"},
{"field": "school_code", "title": "level", "type": "nominal"},
{"field": "grade", "type": "nominal"},
{"field": "filter_method", "type": "nominal"},
{"field": "threshold", "type": "nominal"}
],
"x": {"field": "year_lab_q", "type": "temporal"},
"y": {"field": "perc", "type": "quantitative"}
},
"mark": {"point": true, "type": "line"}
}
],
"resolve": {"scale": {"color": "independent"}},
"title": "A title!",
"width": 700
}
It appears that your temporal values are not being parsed correctly in firefox (details of javascript date parsing behavior is often browser-dependent). You could try forcing the correct parsing by changing your data specification (in both places) to:
"data": {
"name": "data-72a083843a98847e44077116c495e448",
"format": {"parse": {"year_lab_q": "date:%Y"}}
}
This should ensure that the year string is parsed as a year, rather than e.g. a unix timestamp.
The other place date parsing is happening is in your domain specification. You might try changing those to a more standard time format, e.g.
"domain": ["2013-11-01", "2018-06-01"]

how to view a object without name object in react native?

Object {
"0": 200,
"result": Array [
Object {
"created_at": "1572602716",
"description": "i am description ",
"id": "1",
"title": "gulsan",
"updated_at": "1572602716",
"user_id": "27",
},
Object {
"created_at": "1572603684",
"description": "i am description ",
"id": "2",
"title": "kunal",
"updated_at": "1572603684",
"user_id": "27",
},
Object {
"created_at": "1572603975",
"description": "i am description ",
"id": "3",
"title": "nil",
"updated_at": "1572603975",
"user_id": "27",
},
Object {
"created_at": "1572854783",
"description": "i am description ",
"id": "7",
"title": "nilakash",
"updated_at": "1572854783",
"user_id": "27",
},
Object {
"created_at": "1573114400",
"description": "123",
"id": "8",
"title": "Tapan#gmail.com",
"updated_at": "1573114400",
"user_id": "27",
},
Object {
"created_at": "1573114522",
"description": "Test",
"id": "9",
"title": "Test",
"updated_at": "1573114522",
"user_id": "27",
},
Object {
"created_at": "1573114525",
"description": "Test",
"id": "10",
"title": "Test",
"updated_at": "1573114525",
"user_id": "27",
},
],
}
how to view it component
const obj = state.find((p) => p.title === "nil");
console.log(obj)
output
Object {
"created_at": "1572603975",
"description": "i am description ",
"id": "3",
"title": "nil",
"updated_at": "1572603975",
"user_id": "27",
}
i want show it component
Try the below snippet, you can view the object using this way.
var obj = "{\"0\": 200,\"result\": [{\"created_at\": \"1572602716\",\"description\": \"i am description \",\"id\": \"1\",\"title\": \"gulsan\",\"updated_at\": \"1572602716\",\"user_id\": \"27\"}, {\"created_at\": \"1572603684\",\"description\": \"i am description \",\"id\": \"2\",\"title\": \"kunal\",\"updated_at\": \"1572603684\",\"user_id\": \"27\"}, {\"created_at\": \"1572603975\",\"description\": \"i am description \",\"id\": \"3\",\"title\": \"nil\",\"updated_at\": \"1572603975\",\"user_id\": \"27\"}, {\"created_at\": \"1572854783\",\"description\": \"i am description \",\"id\": \"7\",\"title\": \"nilakash\",\"updated_at\": \"1572854783\",\"user_id\": \"27\"}, {\"created_at\": \"1573114400\",\"description\": \"123\",\"id\": \"8\",\"title\": \"Tapan#gmail.com\",\"updated_at\": \"1573114400\",\"user_id\": \"27\"}, {\"created_at\": \"1573114522\",\"description\": \"Test\",\"id\": \"9\",\"title\": \"Test\",\"updated_at\": \"1573114522\",\"user_id\": \"27\"}, {\"created_at\": \"1573114525\",\"description\": \"Test\",\"id\": \"10\",\"title\": \"Test\",\"updated_at\": \"1573114525\",\"user_id\": \"27\"}]}";
var jsonObj = JSON.parse(obj);
console.log(jsonObj.result[0]);

Docusign List Population with Rest Endpoint (Modify Existing Recipient Tabs)

We are trying to populate an existing empty list on a DocuSign Template with some contact methods. The list needs to be populated on the fly since the number and default selected contact method varies with each recipient.
Here is our JSON request we PUT to https://demo.docusign.net/restapi/v2/accounts/:accountId/envelopes/:envelopeId/recipients/:recipientId/tabs (we have confirmed at the necessary variables in the URL have been filled in).
{
"accountId":"163051",
"checkboxTabs":[],
"companyTabs":[],
"dateTabs":[],
"emailTabs":[],
"envelopeId":"048f9ee2-df6e-482d-9e04-abb5e630bf83",
"fullNameTabs":[],
"initialHereTabs":[],
"listTabs":[{
"documentId":"1",
"locked":"False",
"name":"Preferred Contact Method",
"pageNumber":"1",
"tabId":"661499f2-4dda-419d-82ad-f943871407e9",
"tabLabel":"Preferred Contact Method",
"value":"Any",
"listItems":[{
"selected":"True",
"text":"Any",
"value":"1"},{
"selected":"False",
"text":"E-mail",
"value":"2"},{
"selected":"False",
"text":"Phone",
"value":"3"},{
"selected":"False",
"text":"Fax",
"value":"4"},{
"selected":"False",
"text":"Mail",
"value":"5"},{
"selected":"False",
"text":"Home Phone",
"value":"6"},{
"selected":"False",
"text":"Mobile Phone",
"value":"7"},{
"selected":"False",
"text":"Text",
"value":"8"},{
"selected":"False",
"text":"Facebook",
"value":"9"}]
}],
"noteTabs":[],
"radioGroupTabs":[],
"recipientId":"1",
"signHereTabs":[],
"textTabs":[],
"titleTabs":[],
"zipTabs":[]
}
And the response we are getting back:
The remote server returned an error: (500) Internal Server Error.
{
"errorCode": "INVALID_TAB_OPERATION",
"message": "The Tab specified is not valid for the requested operation. Attempt to create 'text' tab from invalid tab type.
}
There are no text tabs in our request. There is a tab with ID 661499f2-4dda-419d-82ad-f943871407e9 of type List on the template.
We were able to get this working a few months ago but fear a new version may have broken this functionality.
In case it is needed here is the "Get Recipient Tabs" response for the same envelope we are trying to modify. The list tab in question is at the bottom.
{
"signHereTabs": [
{
"name": "Sign Here",
"tabLabel": "Signature 12",
"scaleValue": 1,
"optional": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "106",
"yPosition": "270",
"tabId": "00de6704-729d-4726-b102-829f914fda56"
}
],
"dateSignedTabs": [
{
"name": "Date Signed",
"value": "",
"tabLabel": "Date Signed",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "385",
"yPosition": "303",
"tabId": "6236a6cc-2d13-452e-af9b-6fe9706ff500"
}
],
"textTabs": [
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Last Name",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "36",
"yPosition": "146",
"tabId": "5aaee6db-a26a-4102-b77e-2eb4fb6e0c5b"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "First Name",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "224",
"yPosition": "147",
"tabId": "999d3f04-99b5-4fae-b69f-bd3e6b27e30d"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "false",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"maxLength": 1,
"tabLabel": "Middle Initial",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "368",
"yPosition": "145",
"tabId": "fdb77bb3-bbe0-4a0c-bf66-ac9fbaa4bb26"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "false",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Maiden Name",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "427",
"yPosition": "145",
"tabId": "ae99f579-0016-4839-b179-444fae166f71"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Address Street",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "36",
"yPosition": "175",
"tabId": "506abe87-b144-4d93-8576-b33a2abc4d85"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "false",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Apt",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "367",
"yPosition": "173",
"tabId": "7eaa32ef-b9b3-40e5-a5d3-5975134fb90d"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "DOB",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "429",
"yPosition": "175",
"tabId": "8f895bec-4f7a-4040-be77-f17374b30765"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Address City",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "36",
"yPosition": "202",
"tabId": "af6cbd27-072f-494d-8cb0-f60578b5e6c9"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Address State",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "212",
"yPosition": "202",
"tabId": "1ecc4a85-5252-4f4f-97d8-22238f46aae5"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Address Zip",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "368",
"yPosition": "202",
"tabId": "0dfb3731-7ce4-4c10-81f2-784428427ee7"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "false",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 17",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "446",
"yPosition": "256",
"tabId": "cb9a86c5-6ecf-4593-8c54-4b7e7d08ffb8"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "false",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 18",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "497",
"yPosition": "270",
"tabId": "0fc2dc21-7916-431f-aa38-a3b4df6c7bcf"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "false",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 19",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "498",
"yPosition": "283",
"tabId": "e0f8676f-6f98-43ee-81db-63734bfe3155"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "I am willing to travel.",
"width": 162,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 49",
"documentId": "1",
"recipientId": "1",
"pageNumber": "5",
"xPosition": "55",
"yPosition": "15",
"tabId": "5c3ddd45-c36c-4214-8b80-d800e0fa5b61"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "I am NOT willing to travel.",
"width": 162,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 50",
"documentId": "1",
"recipientId": "1",
"pageNumber": "5",
"xPosition": "56",
"yPosition": "41",
"tabId": "47d7d2ff-2a4f-4de7-9f67-311cd0b172c8"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "Preferred Contact Method",
"width": 138,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 52",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "81",
"yPosition": "21",
"tabId": "75b83aa1-c906-4827-9fc2-6cc4177843c6"
}
],
"ssnTabs": [
{
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "SSNTOOLTIP",
"value": "",
"width": 48,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "SSN",
"documentId": "1",
"recipientId": "1",
"pageNumber": "4",
"xPosition": "429",
"yPosition": "204",
"tabId": "11b62284-7613-48df-8498-fa019f3a42a3"
}
],
"radioGroupTabs": [
{
"documentId": "1",
"recipientId": "1",
"groupName": "Radio Button 13",
"radios": [
{
"pageNumber": "4",
"xPosition": "297",
"yPosition": "229",
"value": "Radio",
"selected": "false",
"tabId": "2b2312d2-3ed6-469e-8aeb-8de588ae16d3"
},
{
"pageNumber": "4",
"xPosition": "297",
"yPosition": "243",
"value": "Radio",
"selected": "false",
"tabId": "1a997301-f5d8-4e86-8ead-9d706490faf2"
},
{
"pageNumber": "4",
"xPosition": "297",
"yPosition": "256",
"value": "Radio",
"selected": "false",
"tabId": "705df9df-9e1d-478b-b991-9b31e919c85c"
},
{
"pageNumber": "4",
"xPosition": "297",
"yPosition": "271",
"value": "Radio",
"selected": "false",
"tabId": "d74742c2-742e-43d5-b1c5-04854ec8a7c5"
}
]
},
{
"groupName": "Radio Button Group Test",
"radios": [
{
"pageNumber": "5",
"xPosition": "28",
"yPosition": "15",
"value": "TravelYes",
"selected": "false",
"tabId": "30962105-0337-4d98-b4dd-058ae736d6fb"
},
{
"pageNumber": "5",
"xPosition": "27",
"yPosition": "40",
"value": "TravelNo",
"selected": "false",
"tabId": "351ba656-80dd-43ea-936a-fd322d63c0c0"
}
]
}
],
"listTabs": [
{
"listItems": [
{
"text": "",
"value": "",
"selected": "true"
},
{
"text": "",
"value": "",
"selected": "true"
}
],
"value": "",
"width": 77,
"shared": "false",
"requireInitialOnSharedChange": "false",
"tabLabel": "Preferred Contact Method",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "220",
"yPosition": "20",
"tabId": "661499f2-4dda-419d-82ad-f943871407e9"
}
]
}
This is a confirmed bug with DocuSign. I'm hoping this will get fixed in the next release but can't confirm yet. Once fixed I will update this answer to include the elements of a proper api call to modify an existing listTab, which I believe you're currently doing.