i have created a layout page and having two components in it , now I want to pass variables from one to another
Hi @Dinesh_Kumar !
Can you provide some more details on your Experience dashboard? What kind of components and variables are you referring to, and what is the objective?
I have page layout , in which I am calling two components , one is having dashboard and another one is having some custom html.
Component having Dashboard:
a context variable is defined in the dashboard , and Calling in component this way :
.The value of context variable is coming from exp user tag
component having custom HTML:
In this Input field is there , when the user hits submit button an workflow runs to change the value of experince usertag
I have used user update node in workflow and update the property.
on submit the form with some input , the value of exp usertag is updated but the context variale value is not get at that time updated . but if I reload the page value gets upadted in dashboard.
i also tried using ctxChange event in dashboard, but no success.
So it sounds like you are expecting changes to your experience user to automatically appear in the resolved context object. Currently, we only validate and resolve context variables on the dashboard’s initial mount - though I do think it is reasonable to expect updates to devices and experience users made elsewhere - whether in a form on the same experience page or through some other process - to be reflected in the dashboard.
I will file a feature request around this. We can at least poll the endpoints (re-request regularly) that validate dashboard context and return the dashboard layout itself; I do not know if we can open a stream that would send such updates down in real time.
In the meantime, I suggest not submitting your form asynchronously and allowing the page to fully reload on submission. I understand this is less ideal than an immediate update but it is better than your data being out of sync.
Also, one unrelated suggestion: I see that you are submitting the form as a GET request. HTTP specifications dictate that a GET request should never alter the state of your application, which your form is doing if it is updating a tag on an experience user. (Browsers may also cache this response, which you do not want in this case.) I would recommend changing the endpoint’s method - and your form’s submission method - to PATCH or POST.