logo

NJP

Part 21 - Saving Comments via Data Broker

Import · Mar 17, 2021 · video

[Music] welcome guys to ui builder video series and in the last video we saw that that how we can add this uh comment component in our knowledge article page and uh we added a data broker script as well to retrieve the comments but right now it is empty so what we're gonna do is that in this video what we're gonna do is that we gonna put data broker to save the comments basically so what we're gonna do is that we're gonna add a new data record uh data broker resource and again i'll search for knowledge and here is insert knowledge comment we'll just add it and save it now we gonna come on to this nested comment one and in the event comment submitted and we gonna hook it up no that is insert knowledge comment one [Music] [Music] yes so these are nothing these are payload data and context data so the comment one is payload one so payload dot content and article id is context dot prop dot society and parent id is basically my pay uh payload parent can you can you have hover over to that i okay just click on that okay so uh right now we don't know like what exactly uh these uh parent id mean we'll quickly check uh before we you know but right now we just set it up yep and apply this and save it [Music] and now if i will let's say i'll go here i'll refresh this page i'll click on post comment let's say that i'll add test command to check and post it so right now we are still not seeing that because we have not hooked up that how we can show the latest one but what we can do is we can come here and here we are having our feedback as a test command if i open this record i can see my comment section here so it shows that our comments are saved successfully for this article now to check this that how he came up with all this nesting comments and what is this parent id and all these things do we have any kind of documentation that from where anyone can see what is the supposed value i just i just play around with couple of things and i got this and it just works because article id makes sense right we already have it set on the prop and if you see that insert uh so the content right the uh payload content and the parent id i guess okay i get that now so basically uh the component what we have right the the uh nested comments component uh is when you type something in that text box right that's the content and it's stored in the payload and at the same time it is saying parent id is i think it is uh i mean the closest thing i could relate to is the uh article yeah basically it's it's the same thing that they have parent here uh in the so parent daddy is the only one which we don't know how uh why it is like that can we just remove it let's let's try it out no no it will not work reason is that that parent is actually buying to this article record no but but hold on uh are you sure yeah yeah so let's let's do one no no go back go back because that's the article id right so uh this is a different report this is a different record so if i open this record so how does this yeah yeah so it's article right click it's article so internally i don't know so so we already we already passing the article id right that's what i was saying like we're already partying uh passing out passing article id why do we need parent id so let's remove the parent id i want to see i mean i'm curious let me just uh check it and so we don't have any of the parent here let me yeah let's let's do one thing let's let's cut it save it refresh it let's add one now we have our comment after refreshing testing one two three post and let's go back refresh it i don't see any okay so we need that i mean probably we will come back to it later but right now at this point we don't know yeah so let's save it i don't think so it will work like that can you go back and see if it is saved correctly we can surely check it is oh it's against this [Music] post yep it saved um and if i refresh it hard refresh it then i can see my comments as well so that's it folks for this video and the next one what we are going to show is that how we can have a soft refresh so basically a live refresh that as soon as you post it then we get the latest one thank you thank you

View original source

http://www.youtube.com/watch?v=8oltOmJFqLc