- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2020 09:18 PM
I have to pass data from server to HTML or vice versa how would i achieve that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2020 09:25 PM
You can do it like this
HTML:
<textarea id="comments" name="comments" rows="4" cols="30" ng-model="c.data.comments">
</textarea>
Server Side:
if (input && input.op && userApprovalAccess) {
gr.comments = input.comments;
}
In var field line,
use this
var fields = $sp.getFields(gr, 'state,sys_created_on,comments');
use this below data.fields = fields;
var work = gr.comments.getJournalEntry(1);
var array = work.split(")");
data.comment = array[1];
Now,In comments we have got comment we entered
In HTML to display server side data use
Comment:<div>{{c.data.comment}}</div>
It will pass data from HTML to server side
Please mark correct and helpful if it helps you.
In case of any further help.please message me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2020 08:31 AM
Yes i did that thanks amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2020 09:11 PM
Welcome Priyanka.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2020 05:36 AM
Hi Priyanka,
If you want to transfer data from HTML to Server directly you can not, you will need the Client Script
Example:
In HTMl if you have some HTML tag with name c.variable1
Then in client you can use c.data.varibale2 = c.variable1;
Then in server you can use with input.varibale2;
If you want data from Server to HTML you can use directly without going in client Script;
Example:
In server out the value in data.variable_name & then use it wherever you want in HTML
If the above code helps then please mark my answer Correct and Helpful.
Thanks and Regards:
Siddhnath Pandey

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2020 06:15 AM
Hi,
Server Script to HTML Script:
Server Script:
data.var = "Test";
Html Side:
<span>{{data.var}}</span>
Html Script to Client Script:
For this you can refer @Siddhnath Pandey
Thanks,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2020 08:32 AM
Thanks everyone