Important! A new Community experience launched on September 26, 2017. Read more about it here or continue to Base Camp.
Voting: 
Vote up!
0 Votes
1 Replies

How can i populate an image from sevice call to segment dynamically

chenna Baigani on Nov 20, 2015 05:55 EST

Posted In
Vote up!
0 votes
Vote down!

Hi  Chenna Baigan,

Thanks for writing to us.

We hope you have created a form with segment having image added into it.

Once service gives result then you may need to write code like below to fetch image URL from result.

                function populateImage(status, result) {

                if (status == 400) {

                                if (result["opstatus"] == 0) {

                                                if (result != null && result != undefined) {

                                                                var segmentData = [];

                                                                for (var i = 0; i < result["data"].length; i++) {

                                                                                segmentData.push({

                                                                                                "imgIcon" : result["data"][i]["imageUrl"],

                                                                                               

                                                                                })

                                                                }

                                                                frmProduct.yourSegmentId.setData(segmentData);

                                                               

                                                }

                                }

                }

Please do let us know if further assistance is required from us.

Thanks,

Subbareddy.

Replied by: Nov 24, 2015 02:54 EST