Json Parse
Posted: Sun Apr 03, 2022 6:03 pm
Hi
i have a fileUploader in form and save it by json encode.
and then i wanna set it from database by ajax and by JSON.parse or json_decode().
i tried some but i could not show data in fileuploader in my form.
"filxtasavirmalk" is my fileuploader. who can help me???
var host = PMDynaform.getHostName();
var ws = PMDynaform.getWorkspaceName();
var token = PMDynaform.getAccessToken();
var app_uid = PMDynaform.getProjectKeys().caseUID;
var trig_uid = "27808216861497bd5d107f3041511529"; // what is this id? it is id for trigger show details.
function my_function() {
$.ajax({
type: 'PUT',
url: host + '/api/1.0/' + ws + '/cases/' + app_uid + '/execute-trigger/' + trig_uid,
data: {
id: $('#save_id').getValue()
},
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
}
}).done(function(data) {
if (data.data != null) {
// $('#filxtasavirmalk').setValue(JSON.parse(data.data[1].filxtasavirmalk));
$('#filxtasavirmalk').setValue(data.data[1].filxtasavirmalk);
}
i have a fileUploader in form and save it by json encode.
and then i wanna set it from database by ajax and by JSON.parse or json_decode().
i tried some but i could not show data in fileuploader in my form.
"filxtasavirmalk" is my fileuploader. who can help me???
var host = PMDynaform.getHostName();
var ws = PMDynaform.getWorkspaceName();
var token = PMDynaform.getAccessToken();
var app_uid = PMDynaform.getProjectKeys().caseUID;
var trig_uid = "27808216861497bd5d107f3041511529"; // what is this id? it is id for trigger show details.
function my_function() {
$.ajax({
type: 'PUT',
url: host + '/api/1.0/' + ws + '/cases/' + app_uid + '/execute-trigger/' + trig_uid,
data: {
id: $('#save_id').getValue()
},
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
}
}).done(function(data) {
if (data.data != null) {
// $('#filxtasavirmalk').setValue(JSON.parse(data.data[1].filxtasavirmalk));
$('#filxtasavirmalk').setValue(data.data[1].filxtasavirmalk);
}