Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

guideBridge API to prefill adaptive form with json

Avatar

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
rohitn62196663
Level 3

15-05-2018

I am trying to prefill an adaptive form with json which is as per the json schema which I used to create the form. For testing purpose I have create a mock prefill data in the json format in a file and I am able to read that json and prefill form using the below guideBridge api:

guideBridge.restoreGuideState({

     dataRef : "file:///C:/Users/prefill.json",

     success: function(guideResultObject){

    console.log("prefill success");

     },

     error : function (guideResultObject) {

    console.log("prefill error");

     }

});

But in my use case I will be getting the json from a rest url and we need to send post some params to get that data. So I wrote an ajax call to get the jsonresponse. So Is there a way to include the jsonObject itself within the guideBridge.restoreGuideState api to prefill the data ? I have looked into the guidebridge documentation but didn't find anything related to this use case.

Replies

Avatar

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
rohitn62196663
Level 3

17-05-2018

Any update on this query please ?

In the dataRef itself I can include a rest endpoint but even for that I need to post some params to get the response back. Is there a way to do that ?

Avatar

Avatar
Validate 25
Level 5
James_R_Green
Level 5

Likes

47 likes

Total Posts

191 posts

Correct Reply

47 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 5
James_R_Green
Level 5

Likes

47 likes

Total Posts

191 posts

Correct Reply

47 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
James_R_Green
Level 5

17-05-2018

guideBridge.restoreGuideState({

                guideState : response.guideState,

                error : function (guideResultObject) {

                    console.log('failed', guideResultObject);

                }

            });

My reply on the following post might help as a full example

https://forums.adobe.com/message/10202335

Avatar

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
rohitn62196663
Level 3

01-06-2018

Thanks for the reply. In your example, the json which we get is the entire form guideState object. But in my case the JSON object should be in the format of the datamodel which i configured initially with the form. It should have the bound and unbound tags. In that way it will be prefilled automatically without writing the custom script. The dataRef url which I posted in the question gives me the json in that format itself. So I am checking to see if there is a way to pass that json to guideBridge.restoreguidestate function so that it will be prefilled.

I cant directly metion the url in the dataref itself because to that url (rest endpoint) I need to post params which I dont think it's possible with guideBridge.restoreguidestate function.